winforms - Where and when is InitializeComponent called in Windows Forms control in VB.NET? -
I am projecting a Windows project in VB.NET, but VB.NET is completely new to me, I Mainly a C # developer
In the C # Windows form, the initialize component of a user control is called from the form / control constructor. When I make the same scenario in VB.NET, I can not find a constructor, and I can not locate the place where InitializeComponent is called.
I have to call my code between InitializeComponent and when the control code load
is picked up, preferably still in the constraint of the control. How do I do this in VB.NET?
Look at the code in your form, and right drop down from it and select "New method".
There you can see where the initial group is called and insert your logic.
Your code, if your form is empty, should look like this:
public class form 1 public sub-new () 'This call is required by the Windows Form Designer. InitializeComponent () Add any start after the 'InitializeComponent () call. End Sub End Class
Comments
Post a Comment