H
Helmut Wagensonner
Hi,
I have created a custom textBox within a C# project. I want to put that
custom textBox on a form now. I heard about a way, to place that user
control onto a form within the same project, without having to compile it
seperately before.
An example:
1. In Visual Studio create a new C# Windows Application
2. Add a User Control to the Project
3. Modify the code of the control so that it inherits from
System.Windows.Forms.TextBox
4. Overwrite some function (i. e. OnDragEnter)
protected override void OnDragEnter(DragEventArgs drgevent)
{
MessageBox.Show("Test");
base.OnDragEnter (drgevent);
}
5. ...and this is where I stuck: Add this modified textBox to the existing
Form1
It's not possible, to simply drag it on the Form (in Design View), like you
do with controls from the Toolbox. I know, that there's a way. I saw this a
couple of months before in some presentation, but cannot remember how the
guy did this.
Anybody out there knows?
I have created a custom textBox within a C# project. I want to put that
custom textBox on a form now. I heard about a way, to place that user
control onto a form within the same project, without having to compile it
seperately before.
An example:
1. In Visual Studio create a new C# Windows Application
2. Add a User Control to the Project
3. Modify the code of the control so that it inherits from
System.Windows.Forms.TextBox
4. Overwrite some function (i. e. OnDragEnter)
protected override void OnDragEnter(DragEventArgs drgevent)
{
MessageBox.Show("Test");
base.OnDragEnter (drgevent);
}
5. ...and this is where I stuck: Add this modified textBox to the existing
Form1
It's not possible, to simply drag it on the Form (in Design View), like you
do with controls from the Toolbox. I know, that there's a way. I saw this a
couple of months before in some presentation, but cannot remember how the
guy did this.
Anybody out there knows?