Results 1 to 4 of 4

Thread: msflexgrid alignment

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2009
    Posts
    86

    msflexgrid alignment

    Sir,

    I am using msflexgrid in my vb6 application. what I seen when grid is populeted some entries in grid is aligned abnormally i.e. most are left aligned and some are right. when closely seeing them, it is found that those are having first character as a number.

    I am not able to control it. even though I hav trimmed the source data.
    Pl. guide me how to do that.

    Thanks and regards

    Neeraj

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: msflexgrid alignment

    It's easy to control by setting ColAlignment property's value
    Code:
    MSFlexGrid1.ColAlignment(0) = flexAlignLeftCenter
    MSFlexGrid1.ColAlignment(1) = flexAlignRightCenter
    Choose appropriate from one below:
    ColAlignment, ColAlignmentBand, ColAlignmentHeader Properties (MSHFlexGrid)


    Returns or sets the alignment of data in a column. This can be a standard column, a column within a band, or a column within a header. This property is not available atdesign time (except indirectly through the FormatString property).

    Syntax

    object.ColAlignment(number) [=value]
    object.ColAlignmentBand(number) [=value]
    object.ColAlignmentHeader(number) [=value]

    Syntax for the ColAlignment, ColAlignmentBand, and ColAlignmentHeader properties has:

    Part Description
    object Anobject expression that evaluates to an object in the Applies To list.
    number A Long value that specifies the number of the column in the MSHFlexGrid.
    value An integer orconstant that specifies the alignment of data in a column, as described in Settings.


    Settings

    The settings for value are:

    Constant Value Description
    flexAlignLeftTop 0 The column content is aligned left, top.
    flexAlignLeftCenter 1 Default for strings. The column content is aligned left, center.
    flexAlignLeftBottom 2 The column content is aligned left, bottom.
    flexAlignCenterTop 3 The column content is aligned center, top.
    flexAlignCenterCenter 4 The column content is aligned center, center.
    flexAlignCenterBottom 5 The column content is aligned center, bottom.
    flexAlignRightTop 6 The column content is aligned right, top.
    flexAlignRightCenter 7 Default for numbers. The column content is aligned right, center.
    flexAlignRightBottom 8 The column content is aligned right, bottom.
    flexAlignGeneral 9 The column content is of general alignment. This is "left, center" for strings and "right, center" for numbers.


    Remarks

    Any column can have an alignment that is different from other columns. The ColAlignment property affects all cells in the specified column, including those in fixed rows.

    To set individual cell alignments, use the CellAlignment property. To set column alignments at design time, use the FormatString property.

    If the MSHFlexGrid is in vertical mode, the setting ColAlignment(3) may affect columns in multiple bands.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2009
    Posts
    86

    Re: msflexgrid alignment

    thanks, Problem Solved

  4. #4
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: msflexgrid alignment

    To align individual cells:
    MSFlexGrid1.Row = 5
    MSFlexGrid1.Col = 3
    MSFlexGrid1.CellAlignment = flexAlignRightCenter
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width