Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1438
  • Last Modified:

MSFlexGrid alignment problem in VB 6.0

How do I align Flexgrid fixed header to left in VB 6.0 ?


Code of my flexgrid: 
.Rows = 2
.FixedRows = 1
.FixedCols = 0
.Rows = 2
.TextMatrix(0, 0) = "Issue Date"
.ColWidth(0) = 1150
.TextMatrix(0, 1) = "Rate 360"
.ColWidth(1) = 1050
.TextMatrix(0, 2) = "Rate 180"
.ColWidth(2) = 1050
.TextMatrix(0, 3) = "Rate 5/1"
.ColWidth(3) = 1050
.TextMatrix(0, 4) = "Rate 1/1"
.ColWidth(4) = 1050

Open in new window

0
sivachirravuri
Asked:
sivachirravuri
  • 2
1 Solution
 
PaulHewsCommented:
To make a column left aligned, you would use the ColAlignment property.

If you need to align particular cells without aligning the entire column, use the .CellAlignment property.

The constants don't come up in intellisense, but they are listed in the help.
Constant Value Description
flexAlignLeftTop 0 The cell content is aligned left, top.
flexAlignLeftCenter 1 Default for strings. The cell content is aligned left, center.
flexAlignLeftBottom 2 The cell content is aligned left, bottom.
flexAlignCenterTop 3 The cell content is aligned center, top.
flexAlignCenterCenter 4 The cell content is aligned center, center.
flexAlignCenterBottom 5 The cell content is aligned center, bottom.
flexAlignRightTop 6 The cell content is aligned right, top.
flexAlignRightCenter 7 Default for numbers. The cell content is aligned right, center.
flexAlignRightBottom 8 The cell content is aligned right, bottom.
flexAlignGeneral 9 The cell content is of general alignment. This is "left, center" for strings and "right, center" for numbers.


Option Explicit
 
Private Sub Form_Load()
Dim i As Integer
With MSFlexGrid1
.Rows = 2
.FixedRows = 1
.FixedCols = 0
.Cols = 5
.TextMatrix(0, 0) = "Issue Date"
.ColWidth(0) = 1150
.TextMatrix(0, 1) = "Rate 360"
.ColWidth(1) = 1050
.TextMatrix(0, 2) = "Rate 180"
.ColWidth(2) = 1050
.TextMatrix(0, 3) = "Rate 5/1"
.ColWidth(3) = 1050
.TextMatrix(0, 4) = "Rate 1/1"
.ColWidth(4) = 1050
 
For i = 1 To 4
    .ColAlignment(i) = flexAlignLeftCenter
Next
End With
End Sub

Open in new window

0
 
sivachirravuriAuthor Commented:
Thanks, I already solved. Your comments was correct.
0
 
PaulHewsCommented:
>Thanks, I already solved. Your comments was correct.

I gave you a complete and accurate solution.   Why do you consider it worth only a B grade?

Please see the grading information:
http://www.experts-exchange.com/help.jsp#hi403



0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now