Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resizing a custom control

Status
Not open for further replies.

TJones8

Technical User
Apr 16, 2002
77
0
0
GB
Hi, I'm making a custom crtol and i need it to only have a resizeable width.

I handle the base Resize event with this code
Code:
Private Sub OBControl_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
   Me.txtPart.Width = Me.Width
   Me.cmbPart.Width = Me.Width
   Me.Height = 24
End Sub

Although this resizes the txtPart and cmbPart (a text and combo box respectivly), it does not stop the control from being made taller when in a form design mode.

thx for any help

TJ

if at first you don't succeed, get a 10lb lump hammer
 
Override the Height property of the control to set it to a constant.

Craig
 
OK, this is giving me some odd results (such as if you try to resize it using the top resize box, it simply moves the control up.

Is there a way that putting the control on the form and simply not allowing to to be resized vertically??

if at first you don't succeed, get a 10lb lump hammer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top