From: Jack T. on
Yes

hFont = CreateFont(13, 0, 0, 0, 700, 1, 0, 0, 1, 0, 0, 0, 0, "Verdana")

SendMessage statusbar.hwnd, WM_SETFONT, hFont, ByVal True


"LondonLad" <LondonLad(a)discussions.microsoft.com> wrote in message
news:47FE43E7-0895-45BF-B0CA-A61C10941FA8(a)microsoft.com...
> Hi MikeD
>
> Q. Would it also be possible to change the font color in the statusbar?
>
> "MikeD" wrote:
>
>>
>>
>> "Martin" <ironwoodcanyon(a)gmail.com> wrote in message
>> news:n4cnj5hpgpd71uma9b4p9fdjjakcftpr6m(a)4ax.com...
>> > I've googled around a bit but couldn't find anything.
>> >
>> > Is there a way to set the BackColor of a panel in a StatusBar?
>>
>> Send it a SB_SETBKCOLOR message.
>>
>> Option Explicit
>>
>> Private Const CCM_SETBKCOLOR As Long = &H2001&
>> Private Const SB_SETBKCOLOR As Long = CCM_SETBKCOLOR
>> Private Const CLR_DEFAULT As Long = &HFF000000
>> Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
>> (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
>> Any) As Long
>>
>> Private Sub Form_Click()
>>
>> Call SendMessage(StatusBar1.hwnd, SB_SETBKCOLOR, 0&, ByVal RGB(255,
>> 0,
>> 0))
>>
>> End Sub
>>
>>
>> Note that if the status bar has a sizing handle, the sizing handle
>> doesn't
>> change color. So, this "works" best if the status bar is using the
>> simple
>> style.
>>
>> --
>> Mike
>>
>>
>> .
>>

From: MikeD on


"LondonLad" <LondonLad(a)discussions.microsoft.com> wrote in message
news:47FE43E7-0895-45BF-B0CA-A61C10941FA8(a)microsoft.com...
> Hi MikeD
>
> Q. Would it also be possible to change the font color in the statusbar?
>

Not that I know of. There is no message for setting the text color. If you
can make a StatusBar owner-drawn, then maybe...but I don't see anything in
its documentation for making it owner-drawn. You could probably fake it by
overlaying a picture box and then either printing directly onto the picture
box or using Label controls contained in the picture box. But it's not
something I would really recommend. For that matter, I really don't even
recommend changing the backcolor except for short durations to temporarily
bring attention to something in the status bar.

--
Mike


From: Jack T. on
Opps, sorry for my last post. I should have read the whole thing.


"LondonLad" <LondonLad(a)discussions.microsoft.com> wrote in message
news:47FE43E7-0895-45BF-B0CA-A61C10941FA8(a)microsoft.com...
> Hi MikeD
>
> Q. Would it also be possible to change the font color in the statusbar?
>
> "MikeD" wrote:
>
>>
>>
>> "Martin" <ironwoodcanyon(a)gmail.com> wrote in message
>> news:n4cnj5hpgpd71uma9b4p9fdjjakcftpr6m(a)4ax.com...
>> > I've googled around a bit but couldn't find anything.
>> >
>> > Is there a way to set the BackColor of a panel in a StatusBar?
>>
>> Send it a SB_SETBKCOLOR message.
>>
>> Option Explicit
>>
>> Private Const CCM_SETBKCOLOR As Long = &H2001&
>> Private Const SB_SETBKCOLOR As Long = CCM_SETBKCOLOR
>> Private Const CLR_DEFAULT As Long = &HFF000000
>> Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
>> (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
>> Any) As Long
>>
>> Private Sub Form_Click()
>>
>> Call SendMessage(StatusBar1.hwnd, SB_SETBKCOLOR, 0&, ByVal RGB(255,
>> 0,
>> 0))
>>
>> End Sub
>>
>>
>> Note that if the status bar has a sizing handle, the sizing handle
>> doesn't
>> change color. So, this "works" best if the status bar is using the
>> simple
>> style.
>>
>> --
>> Mike
>>
>>
>> .
>>

From: Nobody on
"Jack T." <anywhere(a)anywhere.com> wrote in message
news:%236x29DwiKHA.1236(a)TK2MSFTNGP04.phx.gbl...
> Yes
>
> hFont = CreateFont(13, 0, 0, 0, 700, 1, 0, 0, 1, 0, 0, 0, 0, "Verdana")
>
> SendMessage statusbar.hwnd, WM_SETFONT, hFont, ByVal True

TRUE in C/Windows API = +1 (0000 0001 Hex)
True in VB = -1 (FFFF FFFF Hex)

Use "ByVal 1&" to pass TRUE to API functions.


From: MikeD on

I don't see where that in itself changes the font's color. Also, you
omitted some important information in that you must destroy the font
resource by calling DeleteObject.

--
Mike


"Jack T." <anywhere(a)anywhere.com> wrote in message
news:#6x29DwiKHA.1236(a)TK2MSFTNGP04.phx.gbl...
> Yes
>
> hFont = CreateFont(13, 0, 0, 0, 700, 1, 0, 0, 1, 0, 0, 0, 0, "Verdana")
>
> SendMessage statusbar.hwnd, WM_SETFONT, hFont, ByVal True
>
>
> "LondonLad" <LondonLad(a)discussions.microsoft.com> wrote in message
> news:47FE43E7-0895-45BF-B0CA-A61C10941FA8(a)microsoft.com...
>> Hi MikeD
>>
>> Q. Would it also be possible to change the font color in the statusbar?

First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4
Prev: Problem updateing an Access database
Next: Serial VS USB