Aplication Framework Enabled

ALX

Well-known member
Joined
Nov 16, 2005
Messages
253
Location
Columbia, SC
Programming Experience
10+
Application Framework Enabled

I've noticed that since I enabled the "Application Framework" so that I could capture any unhandled exceptions in VS2005, that there have been some subtle changes in the execution of my app. Any disabled labels on my forms have taken on a new look. The change is mostly cosmetic and I can deal with that. My hang up deals with the alignment of labels on a form or two. I have two associated labels aligned horizontally on a form. With the Application Framework disabled, everything is displayed correctly. When the Application Framework is enabled, one label is displayed lower on the form than it's mate. I can stop the execution with a breakpoint and examine the co-ordinates of the labels and they match (as far as the "Y" co-ordinate goes), but when the app continues, one label is clearly lower on the screen than the other. Has anybody else experienced this behavior?
 
I think it's odd that you should say:
since I enabled the "Application Framework"
given that it is enabled by default.

Anyway, the application framework will enable visual styles. Did you have visual styles enabled before? Perhaps you have the FlatStyle properties of the two Labels set differently so one is displayed using themes and the other is not.

If you can't track down the difference then I'd suggest deleting both and adding two new ones. You can then ensure that any properties you change for one will be changed for the other too.
 
I don't know how the Application Framework got disabled. This app was imported from VB2003 and this may have happened in the transition. Originally the app started in a Sub 'Main' and the Application Framework seems to require start up in a form. I did resolve this alignment issue though and I'm posting this as it may save somebody else the time I wasted trying to figue this out.

This alignment mistake occurs when:

~ The text-alignment for your label is anything other than top-left, top-center, or top-right.

~ The label height fits the text comfortably with space above & below the text but is not quite tall enough to accomodate 2 lines of text.

~ The text in the label is too long to fit in the width allocated for the label.

The text will be shifted to the "top-row" alignment. You can see this by taking an existing label that is text-aligned "bottom-center" and shrinking the width of the label until the text has to be cut off. You'll see the text jump up to the top row alignment. I know this is done in an attempt to complete the text in another line below the 1st line, but if the label height won't accomodate another row of text below, it just 'appears' to be changing the alignment setting. There is something subtle about changing the Application Framework between disabled and enabled that changes the text in labels (maybe padding or spacing) that pushed my labels over the threshold of not being quite wide enough. This drove me nuts for days until I realized that one label wasn't displaying "all" of it's text. I wasted hours trying to resolve this issue. As always, I am my own worst enemy.
 
Back
Top