Simple Label and TextBox question

  • Thread starter John Heitmuller.
  • Start date
J

John Heitmuller.

Hi, I just want to make sure I'm not missing something obvious.
VB.Net controls like the CheckBox are implemented with a label
attached to it. This is very handy. But the TextBox control has no
implementation with a built-in attached label. You have to separately
layout your TextBox and Label controls on a form. It's not a huge
deal, but it would be handy if each TextBox control was automatically
paired with its Label control.

Is this just the way it is, or am I missing something?

Thanks,
John
 
S

Stephany Young

It's just the way it is!

Not that the 'label' of the CheckBox control that you are referring to is
actually it's Text property.

The Text property of the TextBox control is used to set and get the actual
text 'inside' the TextBox.

If you really need such functionality then create a composite user control
comprising a Label and TextBox and thn you will be able to implement it
exactly how you want it.

I would suggest, however, that if having to spend a small amount of time
'laying out' your Labels and TextBoxes is your biggest worry then you doing
very well indeed.
 
J

John Heitmuller.

I would suggest, however, that if having to spend a small amount of time
'laying out' your Labels and TextBoxes is your biggest worry then you doing
very well indeed.

No, I just did not want other .Net programmers snickering at my forms
because I was 'doing it the hard way'. :cool:
 
C

Cor Ligthert[MVP]

John,

Realy funny, I am alwasy asking myself why there is a label on that checkbox
(and radiobutton) . I don't want it mostly.

:)

Cor
 
H

Herfried K. Wagner [MVP]

Stephany Young said:
Not that the 'label' of the CheckBox control that you are referring to is
actually it's Text property.

That's right. It's internally not a label control, it's simply drawn by the
Win32/.NET implementation of the control. So, the checkbox control is not a
composite control, as a button with a caption is not a composite control.
 

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