Link to home
Start Free TrialLog in
Avatar of mindserve
mindserve

asked on

.HighLight = flexHighlightAlways Can this be changed to a specific color

I am using the mshflexgrid and have the control highlight set to  flexHighlightAlways in properties.
It always highlights in grey however. Is there a way to get it to highlight in another color or to get the cell to highlight, or to even get the text color in the cell to change color while it has the focus?
This is an appointment book and it would make it much easier if the users were sure of which client they were on.
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

You could set the cell's BackColor property instead.
Avatar of mindserve
mindserve

ASKER

What about flex focus heavy,, light, can these colors be changed?
Following code will highlight the selected row

'-----------------------------------------------------------------------
'Add MSHFlexGrid grid to a form and copy - paste following code and try clicking on rows
Dim LastSelectedRow As Integer
Private Sub Command1_Click()
MSHFlexGrid1.FixedCols = 0
MSHFlexGrid1.FixedRows = 1
MSHFlexGrid1.Cols = 3
MSHFlexGrid1.Rows = 0
MSHFlexGrid1.SelectionMode = flexSelectionFree
MSHFlexGrid1.AllowUserResizing = flexResizeColumns

'Add Header Row in Grid
MSHFlexGrid1.AddItem "S.No" & vbTab & "Candidate Name" & vbTab & "Mobile No"

'Add rows in Grid
MSHFlexGrid1.AddItem "1" & vbTab & "Candidate 1" & vbTab & "1111111111"
MSHFlexGrid1.AddItem "2" & vbTab & "Candidate 2" & vbTab & "2222222222"
MSHFlexGrid1.AddItem "3" & vbTab & "Candidate 3" & vbTab & "3333333333"


End Sub

Private Sub MSHFlexGrid1_Click()
    'Save current selected row number
    CurrentSelectedRow = MSHFlexGrid1.Row
   
    'Loop through all columns
    For i = 0 To MSHFlexGrid1.Cols - 1
        'Set column
        MSHFlexGrid1.Col = i
        'Make font bold of cell set in above statement
        MSHFlexGrid1.CellFontBold = True
    Next
   
    'Following code is for clearing the last selected row
    MSHFlexGrid1.Row = LastSelectedRow
    For i = 0 To MSHFlexGrid1.Cols - 1
        MSHFlexGrid1.Col = i
        MSHFlexGrid1.CellFontBold = False
    Next
   
    'update variable which will hold the current selected row no.
    LastSelectedRow = CurrentSelectedRow
End Sub
'-------------------------------------------------------------------------------------------------------
ASKER CERTIFIED SOLUTION
Avatar of AbhishekSharma
AbhishekSharma
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial