Have been trying to use Delete key, as in VB6, but nothing happening | | dpowning Thursday, November 19, 2009 4:48 AM |
Public Class Form1
Dim TBox As New TextBox
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'This add a control to the form
Me.Controls.Add(TBox)
'this remove a control from the form
Me.Controls.Remove(TBox)
End Sub
End Class
- Proposed As Answer byChao KuoMSFT, ModeratorMonday, November 23, 2009 7:50 AM
- Marked As Answer byChao KuoMSFT, ModeratorTuesday, November 24, 2009 8:06 AM
-
| | Crazypennie Friday, November 20, 2009 2:47 AM | You mean at design time? You should be able to click on the control and press Delete. I can't think why it wouldn't work. If it really refuses, you can dig through the code and hunt down the location where it is created in the automatically generated code. If you delete that and try to run, you'll get error messages showing you everywhere else the control is referenced. Delete those and you should be ready to go. But I wouldn't do all of that for a small example, only a big program where you don't want to lose a lot of work. For a small example, I'd try starting a new project and see if the problem continues. Rod www.vb-helper.com
- Marked As Answer byChao KuoMSFT, ModeratorTuesday, November 24, 2009 8:06 AM
-
| | Rod Stephens Saturday, November 21, 2009 3:06 PM |
Public Class Form1
Dim TBox As New TextBox
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'This add a control to the form
Me.Controls.Add(TBox)
'this remove a control from the form
Me.Controls.Remove(TBox)
End Sub
End Class
- Proposed As Answer byChao KuoMSFT, ModeratorMonday, November 23, 2009 7:50 AM
- Marked As Answer byChao KuoMSFT, ModeratorTuesday, November 24, 2009 8:06 AM
-
| | Crazypennie Friday, November 20, 2009 2:47 AM | You mean at design time? You should be able to click on the control and press Delete. I can't think why it wouldn't work. If it really refuses, you can dig through the code and hunt down the location where it is created in the automatically generated code. If you delete that and try to run, you'll get error messages showing you everywhere else the control is referenced. Delete those and you should be ready to go. But I wouldn't do all of that for a small example, only a big program where you don't want to lose a lot of work. For a small example, I'd try starting a new project and see if the problem continues. Rod www.vb-helper.com
- Marked As Answer byChao KuoMSFT, ModeratorTuesday, November 24, 2009 8:06 AM
-
| | Rod Stephens Saturday, November 21, 2009 3:06 PM |
|