Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSHFlexGrid set row or individual cell to bold (or selected colour)

Status
Not open for further replies.

keenanbr

Programmer
Oct 3, 2001
469
IE
is it possible to set an individual row or cell to bold or a selected colour within code. if so please show me how.

Thanks in advance
 
Here's a few calls for you...

Flex.CellFontBold = Not Flex.CellFontBold

Flex.CellFontItalic = Not Flex.CellFontItalic

Flex.CellFontUnderline = Not Flex.CellFontUnderline

Flex.CellFontStrikeThrough = Not Flex.CellFontStrikeThrough

Sub...
Flex.CellFontSize = Flex.CellFontSize - 2
If Flex.CellFontSize < 8 Then Flex.CellFontSize = 8
End Sub

Flex.CellFontSize = Flex.CellFontSize + 2

 
Ooops...

Flex.CellForeColor = vbBlue
Flex.CellForeColor = vbRed
Flex.CellForeColor = vbGreen
 
Here is an example to change an entire row.

Code:
   '// Change the font of a row.
   MSFlexGrid1.Row = 3
   MSFlexGrid1.Col = 0
   MSFlexGrid1.RowSel = 3
   MSFlexGrid1.ColSel = MSFlexGrid1.Cols - 1
   MSFlexGrid1.FillStyle = flexFillRepeat
   MSFlexGrid1.CellFontBold = True
   '// Change the back and fore colour of a row.
   MSFlexGrid1.Row = 4
   MSFlexGrid1.Col = 0
   MSFlexGrid1.RowSel = 4
   MSFlexGrid1.ColSel = MSFlexGrid1.Cols - 1
   MSFlexGrid1.FillStyle = flexFillRepeat
   MSFlexGrid1.CellForeColor = vbWhite
   MSFlexGrid1.CellBackColor = vbRed

To change a single cell,

Code:
MSFlexGrid1.Row = 3
   MSFlexGrid1.Col = 3
   MSFlexGrid1.CellFontBold = True



Take Care,

zemp

&quot;Show me someone with both feet on the ground and I will show you someone who can't put their pants on.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top