properties for custom control
-
I have two problems with a property for a custom control: 1) the default value does not show up when the properties for the custom control are viewed. 2) The size of the control at run time reverts to the initial size of the combo box which is the final result of user selections in the custom control. These two problems may be interrelated. The custom control is a composite of standard vb.net controls including a drop down combo (ccdropdown), some buttons, etc. The run time user sees the ccdropdown combo. At run time, when the user clicks on the drop down, the custom control displays the embedded standard controls and allows the user to set the final value which will be displayed as text in the ccdropdown combo box at which time the ccdropdown combox also closes up. The custom control needs to have three different widths depending upon the value of a property that the designer will use. I can create a property called mode, and cause the designer to show the correct size on the design page depending on the value selected in the mode property. The relevant code is as follows: private parm1 as string _ Public Property Mode() As String Get Select Case parm1 Case "Mode1" ccdropdown.Width = 90 Me.Width = 90 Case "Mode2" ccdropdown.Width = 75 Me.Width = 75 Case "Both" ccdropdown.Width = 150 Me.Width = 150 End Select Return parm1 End Get Set(ByVal Value As String) Select Case Value Case "Mode1" ccdropdown.Width = 90 Me.Width = 90 Case "Mode2" ccdropdown.Width = 75 Me.Width = 75 Case "Both" ccdropdown.Width = 150 Me.Width = 150 End Select parm1 = Value End Set End Property Modelist has been initalized to "Mode1","Mode2","Both" me.width is changed so that the designer sees the proper width of the control depending on the mode selection by the designer. I would appreciate any insight into this problem from