View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Vertically centering text in a label field

GS explained on 5/1/2011 :
on 5/1/2011, mondrogan supposed :
Because setting the textbox .enabled property = false results in a
different "look" than the default appearance of a sunken label field.
Prefer the look of the sunken label field. If you tell me there is nothing
I can do to vertically center the font, then maybe I will be forced to use
a textbox after all. But I'm hoping there is something I can do to use
label field.


Why can't you change the 'look' of the textbox so it resembles a sunken
label?


To change a textbox so it 'looks' like a sunken label:

1. Change BackColor to SystemButtonFace.
2. Leave Enabled so the text doesn't display greyed out.
3. In its KeyDown event enter:
KeyCode = 0
This will prevent changes via the keyboard.
This will allow changes via code.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc