Change the alignment of a cell in msflexgrid

Posted on 2006-04-05
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

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

    MSHFlexGrid1.Col =1
    MSHFlexGrid1.CellAlignment = flexAlignLeftBottom

    LVL 18

    Expert Comment

    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
    LVL 2

    Expert Comment


    MSHFlexGrid1.FixedAlignment(1) = 3


    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
    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…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    732 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now