B
Beeeeeves
If I have a project with a component that is derived from a control, say
RichTextBox, I insert this control into a form by placing a standard
RichTextBox on the form, and then doing a find and replace within the code
file of the form, replacing System.Windows.Forms.RichTextBox with the name
of my custom RichTextBox-derived class.
Is this the correct way to do it?
If I then want the RichTextBox to contain another custom control, derived
from, say, a ListBox, I drag a standard ListBox onto the 'virtual'
(peach-colored) designer of the component and do a find and replace again in
the same way, this is because I want all the code to manipulate the custom
ListBox-derived control to be within the code of the RichTextBox-derived
control - but I can't get the ListBox to display* unless its container is
the actual main form itself, which means I have to have the code to
manipulate the custom ListBox-derived control in the form, which I don't
really want. Is there any way I can get the custom RichTextBox-derived
control to completely contain the custom ListBox-derived control?
* when I say it won't display, the Show() method doesn't fire an error, but
it just isn't visible, even if I call BringToFront().
Any ideas?
RichTextBox, I insert this control into a form by placing a standard
RichTextBox on the form, and then doing a find and replace within the code
file of the form, replacing System.Windows.Forms.RichTextBox with the name
of my custom RichTextBox-derived class.
Is this the correct way to do it?
If I then want the RichTextBox to contain another custom control, derived
from, say, a ListBox, I drag a standard ListBox onto the 'virtual'
(peach-colored) designer of the component and do a find and replace again in
the same way, this is because I want all the code to manipulate the custom
ListBox-derived control to be within the code of the RichTextBox-derived
control - but I can't get the ListBox to display* unless its container is
the actual main form itself, which means I have to have the code to
manipulate the custom ListBox-derived control in the form, which I don't
really want. Is there any way I can get the custom RichTextBox-derived
control to completely contain the custom ListBox-derived control?
* when I say it won't display, the Show() method doesn't fire an error, but
it just isn't visible, even if I call BringToFront().
Any ideas?