Listbox Background and Foreground Color

In this category you can exchange your programming questions and solutions.
Post Reply
Darren
Posts: 63
Joined: Wed May 11, 2011 11:55 am

Listbox Background and Foreground Color

Post: # 837Post Darren
Wed Feb 22, 2012 1:50 pm

Can anybody help?

Can anybody tell me how to set the background color of a listbox to black and the text color to white.

Here is my code, I cannot get it to work????

OBJECT ListBox1 AS ListBox
    Left=0
    Top=0
    Width=150
    Height=ScreenHeight - 25
    TabOrder=0
    Sorted=True
    Color=0
    Font.Color=255
  END OBJECT `{ListBoxBox1}

Many thanks in advance!!!

Angel
Posts: 87
Joined: Sat Nov 19, 2011 9:34 am

Listbox Background and Foreground Color

Post: # 838Post Angel
Wed Feb 22, 2012 2:34 pm

The? white color is rgb(255,255,255) or 16777215 or &HFFFFFF.
In your code, the text color es 255 (red color)? and not white color.
I recommend that you download my program "update colormanagement" in the section files.

`Code
Object frmForm As Form
? Caption="Form1"
? Height=480
? Width=640
? Center
? `Otros objetos
? Object Listbox1 As Listbox
? ? Left=0
? ? Top=0
? ? Width=150
? ? Height=Screenheight - 25
? ? Taborder=0
? ? Sorted=True
? ? Color=0
? ? Listbox1.Additem("Probando")
? ? Font.Color=Rgb(255,255,255)
? END OBJECT `{ListBoxBox1}
? `Fin otros objetos
? `OnShow=frmForm_OnShow
? `OnClose=frmForm_OnClose
End Object
frmForm.showmodal

Post Reply