|
-
Jul 1st, 2005, 05:02 AM
#1
Thread Starter
Addicted Member
Label on Statusbar
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
Cute Member 
-
Jul 1st, 2005, 05:16 AM
#2
Re: Label on Statusbar
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.
-
Jul 1st, 2005, 05:24 AM
#3
Thread Starter
Addicted Member
Re: Label on Statusbar
 Originally Posted by jmcilhinney
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.
Could u pls. help me with that?
OR
May be a way to change the backcolor of an individual panel on the statusbar.
Cute Member 
-
Jul 1st, 2005, 05:46 AM
#4
Re: Label on 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.
-
Jul 1st, 2005, 05:54 AM
#5
Thread Starter
Addicted Member
Re: Label on Statusbar
 Originally Posted by jmcilhinney
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.
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.
Cute Member 
-
Jul 1st, 2005, 06:00 AM
#6
Re: Label on Statusbar
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.
-
Jul 1st, 2005, 06:07 AM
#7
Thread Starter
Addicted Member
Re: Label on Statusbar
 Originally Posted by jmcilhinney
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.
OK Thanx
Cute Member 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|