We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


Change the alignment of a cell in msflexgrid

whiwex asked
Medium Priority
Last Modified: 2012-05-05
How do I change the alignment in just a single cell in a MSHFlexGrid?
I use this command but it doesn't change the cell MSHFlexGrid1.CellAlignment = flexAlignLeftBottom.
I'm not sure that it is changing the correct cell. How do I select the proper cell?
I'm doing this in Visaul Basic
Watch Question

Top Expert 2004
You have to define the col and the row, as in:

MSHFlexGrid1.Col =1
MSHFlexGrid1.CellAlignment = flexAlignLeftBottom


Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

As Shauli pointed out, to change the alignment of a single cell, you need to set the focus on that cell first by using the following:
MSHFlexGrid1.Col =1

Then use the cell alignment property:
MSHFlexGrid1.CellAlignment = flexAlignLeftBottom

In case you need to align the whole column then this is how you do it:
MSHFlexGrid1.ColAlignment(1) = flexAlignLeftCenter

To align Fixed columns:
MSHFlexGrid1.FixedAlignment(1) = flexAlignCenterCenter

MSHFlexGrid1.FixedAlignment(1) = 3

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.