Results 1 to 7 of 7

Thread: Label on Statusbar

  1. #1

    Thread Starter
    Addicted Member cutamacious's Avatar
    Join Date
    May 2001
    Location
    INDIA >> Andhra Pradesh >> Hyderabad
    Posts
    185

    Angry 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

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.

  3. #3

    Thread Starter
    Addicted Member cutamacious's Avatar
    Join Date
    May 2001
    Location
    INDIA >> Andhra Pradesh >> Hyderabad
    Posts
    185

    Re: Label on Statusbar

    Quote 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

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.

  5. #5

    Thread Starter
    Addicted Member cutamacious's Avatar
    Join Date
    May 2001
    Location
    INDIA >> Andhra Pradesh >> Hyderabad
    Posts
    185

    Re: Label on Statusbar

    Quote 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

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.

  7. #7

    Thread Starter
    Addicted Member cutamacious's Avatar
    Join Date
    May 2001
    Location
    INDIA >> Andhra Pradesh >> Hyderabad
    Posts
    185

    Re: Label on Statusbar

    Quote 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
  •  



Click Here to Expand Forum to Full Width