vb.net - How can it get VB not to auto generate code for my component -


I create a component class, it increases a combo box and generates some random numbers. But when I drag and drop my component from a toolbox to a form, it automatically creates I.Randtest1.Items.AddRange (...) in the designer which uses static numbers. Thoughts were different numbers each time and were not the same.

  Importing System. Windows Forms Folk Class Randestest Inheritance Combo Box Public Sub New () Set Default Text () Farkomobox () End Sub Private All SetDefaultText () Text = Rnd (10) End Sub Private Sub-fillComboBox () for count = 0 to 5 items. Add (Rnd (10)) Next End Sub End Class  

Thanks

Add to the top of this creator:

  If the DesignMode exit then sub  

In this way, this design does not generate anything at the time Will only run at run time

Just out of curiosity, is it because the user is a random number, or just programmatic?


Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -