[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2394
  • Last Modified:

MS Flex Grid problem, vb6 how to justfiy text (center,left,right) in view.


How do you justify text in ms flex grid??  working code if possible...  Thanks!
3 Solutions
bluedragon99Author Commented:
before data is added not after, to make it easier for ya.
Yupp, I face the same problem too. When a string is started with numeric, let says "2 friends", then it will be aligned to right automatically.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Try this:

flexigrid.ColAlignment(index) = flexAlignRightCenter

The rest of the ColAlignment Properties can be found here:
the following are the constants and their values for alignment

flexAlignLeftTop 0 The cell content is aligned left, top.
flexAlignLeftCenter 1 The cell content is aligned left, center. This is the default for strings.
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 The cell content is aligned right, center. This is the default for numbers.
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

and the code that does it
MSFlexGrid1.Col = 0
MSFlexGrid1.Row = 1
MSFlexGrid1.Text = "left"
MSFlexGrid1.CellAlignment = flexAlignLeftBottom
MSFlexGrid1.Col = 1
MSFlexGrid1.Row = 1
MSFlexGrid1.Text = "right"
MSFlexGrid1.CellAlignment = flexAlignRightBottom
MSFlexGrid1.Col = 2
MSFlexGrid1.Row = 1
MSFlexGrid1.Text = "center"
MSFlexGrid1.CellAlignment = flexAlignCenterBottom

you can set the alignment for a whole column too like lttia1 said
bluedragon99Author Commented:
Thanks great information everyone!!  hope I was fair with the points.
Thanks to you all!

? @_@ ?

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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