-
June 19th, 2014, 02:11 PM
#1
Change Combo1 color
how to chage the color (back + button) of a combo1 ? any suggestion ... ?
Last edited by javabill; June 19th, 2014 at 02:17 PM.
-
June 20th, 2014, 01:05 AM
#2
Re: Change Cobo1 color
Here's a LISTVIEW, but it should be similar:
Code:
Option Explicit
Private Sub Form_Load()
ListView1.FullRowSelect = True
ListView1.View = lvwReport
Dim itmX As ListItem ' Create a variable to add ListItem objects.
Dim clmX As ColumnHeader ' Create an object variable for the ColumnHeader object.
' Add ColumnHeaders.
Set clmX = ListView1.ColumnHeaders.Add(, , "Column 1", ListView1.Width / 3)
Set clmX = ListView1.ColumnHeaders.Add(, , "Column 2", ListView1.Width / 3)
Set clmX = ListView1.ColumnHeaders.Add(, , "Column 3", ListView1.Width / 3)
ListView1.BorderStyle = ccFixedSingle ' Set BorderStyle property.
ListView1.View = lvwReport ' Set View property to Report.
' Add a main item
Set itmX = ListView1.ListItems.Add(, , "First value")
' Add two subitems for that item
itmX.SubItems(1) = "First value subitem 1"
itmX.SubItems(2) = "First value subitem 2"
' Add another main item
Set itmX = ListView1.ListItems.Add(, , "Second value")
' Add two subitems for that item
itmX.SubItems(1) = "Second value subitem 1"
itmX.SubItems(2) = "Second value subitem 2"
' Add another main item
Set itmX = ListView1.ListItems.Add(, , "Third value")
' Add two subitems for that item
itmX.SubItems(1) = "Third value subitem 1"
itmX.SubItems(2) = "Third value subitem 2"
ReDim Preserve clr(ListView1.ListItems.Count)
'Initialise the subclassing
g_MaxItems = ListView1.ListItems.Count - 1
g_addProcOld = SetWindowLong(hWnd, GWL_WNDPROC, AddressOf WindowProc)
End Sub
Private Sub Form_Unload(Cancel As Integer)
SetWindowLong hWnd, GWL_WNDPROC, g_addProcOld
End Sub
Private Sub ListView1_Click()
If ListView1.SelectedItem.Index < 0 Then Exit Sub
SetLIBackColor ListView1, ListView1.SelectedItem.Index, vbRed
End Sub
Not easy, anyways...
-
June 21st, 2014, 11:44 AM
#3
Re: Change Cobo1 color
well... i will try...
thanks a lot
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|