Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-11-25
4
Medium Priority
?
464 Views
Last Modified: 2013-12-26
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.
0
Comment
Question by:mindserve
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 18011844
You could set the cell's BackColor property instead.
0
 
LVL 1

Author Comment

by:mindserve
ID: 18012286
What about flex focus heavy,, light, can these colors be changed?
0
 
LVL 3

Expert Comment

by:AbhishekSharma
ID: 18056838
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
'-------------------------------------------------------------------------------------------------------
0
 
LVL 3

Accepted Solution

by:
AbhishekSharma earned 500 total points
ID: 18056872
Following code will change the font color and also make the fond bold

'-----------------------------------------------------------------------
'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
        MSHFlexGrid1.CellForeColor = &H8000000D
    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
        MSHFlexGrid1.CellForeColor = &H0&
    Next
   
    'update variable which will hold the current selected row no.
    LastSelectedRow = CurrentSelectedRow
End Sub
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question