Newbie: Resize textbox at design time inside usercontrol possible?

G

Guest

Hi all,

I'm new to .NET. I have found a problem that seems simple but I can't
resolve. I
want to create a very simple usercontrol that includes a label and a textbox.

Everything works fine, but I would like to be able to resize the label and
textbox at design time (not resize the entire user control). I have tried
different
approachs without success... I don't want to create a custom desginer for my
usercontrol, I just want to expose the "normal" label and textbox designers...

Is that possbiel? My approach is wrong?

Any ideas are welcome,

TIA
Pucara.
 
P

Peter Proost

Hi,

you could place 2 propertys on your usercontrol to resize the textbox at
design time, the same goes for the label. In my example you can't change the
width of the textbox to anything smaller then 20. Now you can set the extra
propertys in the property window of your usercontrol

hth

Peter

<<<<<<<<code>>>>>>>>>

'The height property will only work if multiline is set to true
Public Property TextBoxHeight() As Integer
Get
Return TextBox1.Height
End Get
Set(ByVal Value As Integer)
TextBox1.Height = Value
End Set
End Property

Public Property TextBoxwidth() As Integer
Get
Return TextBox1.Width
End Get
Set(ByVal Value As Integer)
TextBox1.Width = Value
If Value < 20 Then
TextBox1.Width = 20
End If
End Set
End Property


<<<<<<<<code>>>>>>>>>
 
G

Guest

Thanks for your response Peter. I have done that, but I'm trying to expose the
visual designer. I want to be able to click on the label and resize it
graphically or
do the same with the textbox. It seems that is not possible without writting
my own
designer for the user control, thought the designers for that controls are
already there...

Thanks,

Pucara.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top