Hi all
I would like to have a lable on the statusbar (on MDI). I've placed a label from the toolbox onto the statusbar panel, but the label is invisible during runtime.
Can anybody help on placing a label on status bar panel
thanx in advance
Printable View
Hi all
I would like to have a lable on the statusbar (on MDI). I've placed a label from the toolbox onto the statusbar panel, but the label is invisible during runtime.
Can anybody help on placing a label on status bar panel
thanx in advance
You don't put Labels on a StatusBar. You put StatusBarPanels on a StatusBar. Use the Panels property of the StatusBar to add StatusBarPanels in the designer.
I know that there will be statusbar panels on a statusbar. I also know that we cannot change the background color of a individual panel. Hence the requirement of placing a label with customised backcolor on the status bar.Quote:
Originally Posted by jmcilhinney
Could u pls. help me with that?
OR
May be a way to change the backcolor of an individual panel on the statusbar.
I just tried placing a Label over a StatusBar and had no problems. I'd guess that the issue is with your Z-order. In the designer, right-click the StatusBar and select "Send to Back", or alternatively right-click the Label and select "Bring to Front". You can do this programmatically at run-time also. Every control has BringToFront and SendToBack methods.
Edit:
Using the Label is a hack, though. The "proper" way to do it would be to set the Style of a StatusBarPanel to OwnerDraw and override the OnPaint method to draw your own background colour. That would be a hassle, though, I admit.
Quote:
Originally Posted by jmcilhinney
Oh correct!!. I got it. I mean Placing a label on the statusbar.
However, i would like to know how to use the correct method...I mean overrriding the OnPaint method and drawing your own backcolor.
You know what? I've never actually owner-drawn my own control. I just talk as though I know something. Actually knowing something is a completely different skill that I'm yet to master. I know there are others on this forum who've drawn their own controls many times, though. Do a forum search for related threads or even a help search in the IDE should give you some good info.
Quote:
Originally Posted by jmcilhinney
:D :D OK Thanx :wave: