yaniv Posted December 18, 2002 Posted December 18, 2002 can you add control to the form during runtime. i want to create a form that show pictures, but only if they exist in the data base. Quote
yaniv Posted December 18, 2002 Author Posted December 18, 2002 i forgot the question mark in the end of the first line in my post. have it now- can you add control to the form during runtime? Quote
*Experts* Volte Posted December 18, 2002 *Experts* Posted December 18, 2002 Certainly. '-- In the form Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim btn As New Button() With btn .Size = New Size(90, 40) .Location = New Point(15, 15) .Text = "Testing 1 2 3" 'causes the newbtnClick procedure to fire on the click event. AddHandler btn.Click, AddressOf newbtnClick End With Me.Controls.Add(btn) End Sub Private Sub newbtnClick(ByVal sender As Object, ByVal e As EventArgs) MessageBox.Show("You clicked the button!") End Sub Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.