|T O P I C R E V I E W
||Posted - 19 Mar 2007 : 15:53:09
I have two basic questions/problems concerning creating graphs in Visual Studio 2005 using C#.
Maybe someone could point out what I am doing wrong.
1) When I follow the procedures outlined in the user's manuals for creating graph controls, my new controls do not appear in the toolbox. Why not?
2) Should I be able to "see" the graph control I am creating on the [Design] file of my control. I can only "see" the controls in the sample programs when I view the [Design] file of the form they are installed in, not when I view the [Design] file of the control itself? Why? (I have placed the InitializeGraph() function in the constructor of the control, and also called from the form)
|1 L A T E S T R E P L I E S (Newest First)
||Posted - 19 Mar 2007 : 17:41:04
The following answer assumes that you are using the .Net version of the software, and not the .Net CF version.
1. When you build a ChartView derived control that is part of the project for an application program for the first time, VS seems to be unreliable about when it actually places the control in the toolbox. Sometimes it appears right away, and other times it doesn't. We find that if you view the ChartView derived control's design-time form, rebuild the solution, then go to the main Form of the application, you will see the ChartView derived control in the toolbox for that form. If that doesn't work, save and reload the project. That seems to reinitialize the toolbox with all valid controls of a project.
2. You will NOT be able to see the graph control when viewing the design file of the control. For whatever reason, VS does NOT call the default ChartView constructor when you view the controls design file.
Much the same, if you were to derive a UserControl from some standard .Net control, the ComboBox control for example, you would not acutally be able to see a combo box control when viewing the design file of the control.
It would only appear as an actual combo box when you placed the derived control on a form.