The C# status bar does not have a BackgroundColor property or anything similar.
How can I go about changing it's colour?
My forms are all light blue but the dastardly status bar is still grey!
Maybe an API call?
Printable View
The C# status bar does not have a BackgroundColor property or anything similar.
How can I go about changing it's colour?
My forms are all light blue but the dastardly status bar is still grey!
Maybe an API call?
Use the SendMessage API
I'm not sure the value of SB_SETBKCOLOR you will have to look it upCode:
[DllImport("user32.dll")]
public static extern void SendMessage(IntPtr hWnd, int msg, int wParam, int lParam);
SendMessage sBar.hwnd, SB_SETBKCOLOR, 0, NewBgColor
Thanks you very much Tewl.
For others who also need to know how to change the colour of the status bar:
Add reference:
using System.Runtime.InteropServices;
the value for SB_SETBKCOLOR:
int CCM_FIRST = 0x2000;
SB_SETBKCOLOR = (CCM_FIRST + 1);
hi,
thanks for the code. But I have a problem. In design view it works correct. but when I am running the application, its not working.
my status bar is inside a user control. Can anybody help me ??
Regards,
Reshmi
Within the Usercontrol, make the access specifier of Statusbar Public, then use the SendMessage API likeQuote:
Originally Posted by Reshmi
[Handle] is in C# as [Hwnd] is in VB.Code:SendMessage UserControlName.ProgressBarName.Handle, SB_SETBKCOLOR, 0, NewBgColor
EDIT: Oh, I forgot to add, this is an old thread, so if you have similar question/s, make a seperate/your own thread because it's unlikely that people will open a *RESOLVED* thread.