It is possible to change listbox back color ?

BlitzPlus Forums/BlitzPlus Programming/It is possible to change listbox back color ?

Filax(Posted 2006) [#1]
All is in the title :)


Pineapple(Posted 2006) [#2]
What is it with changing the colour of gadgets? :)

I've tried this in C++:-

   HWND hWnd;
   HWND Gadget;
   HDC hDC;
   COLORREF color = RGB(255,0,255);
   hInst = hInstance; 

   hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

   if (!hWnd)
   {
      return FALSE;
   }

   Gadget = CreateWindow("Button","Button",BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE ,
				20,20,100,20,hWnd,(HMENU)NULL,hInstance,0);

   hDC = GetDC(Gadget);
   RECT  rect = { 0, 0, 100,20  };
   HBRUSH  hBrush = CreateSolidBrush(color);
   FillRect(hDC, &rect, hBrush);
   DeleteObject(hBrush);


Doesnt work, never thought it would really, as I'm a little tipsy at the mo, and I think gadgets are meant to stay boring (unless your programming in Java)! :D

Anyway, my best advice to you is creating your own gadgets within Blitz that can handle stuff you want to do!

If anyone can get this moving (in C++), I'd love to see the source if you don't mind, but personally, I think gadgets in windows are WYSIWYG! :/

Dabz

EDIT: Ive even tried it with 'SelectObject(hDC, hBrush);' in there, without luck.