Obtaining Width of a Table Cell

  • Hi,

    I am trying to find the width of a table cell after the user has re-sized the cell. Using the examples in the user guide I have it almost working except for the following:

    1. I am checking for this in the OnMouseUp event as there doesn't seem to be anything more suitable. This is obviously firing far more often than I would like - is there a better event I should use? This is also leading to problem 2:

    2. The value I am getting from _IsWidthTW is the width of the cell before the resize whereas I need the value after the resize.

    Here is my code:

    • Offizieller Beitrag

    Hi,

    IsWidthTW is calculated by the reformat routine.

    You can also read the properties of the cell - they will be manipulated by the resizing.

    You can use

    WPAT_COLWIDTH_PC = 175; // Width if this cell in per-tenthousand
    WPAT_COLWIDTH = 176; // Width if this cell in twips - has priority over

    with

    AGet( wpat, val ).

    Since also the availalale space limits the size of a column, You can also delay the reading of the width using a timer or a PostMessage to be executed after reformat. (See WPCtrMemo for example)

    Or you use CharacterAttrChange, but only in the case in case Your MouseUp has set a boolean flag.

    Julian