Learn how to a build a cloud-first strategyRegister Now


Change the alignment of a cell in msflexgrid

Posted on 2006-04-05
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
Question by:whiwex
LVL 19

Accepted Solution

Shauli earned 2000 total points
ID: 16387695
You have to define the col and the row, as in:

MSHFlexGrid1.Col =1
MSHFlexGrid1.CellAlignment = flexAlignLeftBottom

LVL 18

Expert Comment

ID: 16390632
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

Expert Comment

ID: 16404440

MSHFlexGrid1.FixedAlignment(1) = 3


Featured Post

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.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

810 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