Announcement

Collapse
No announcement yet.

Changing the Style of the TextBox

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Changing the Style of the TextBox


    I have designed a dialog box using DDT. This dialog contains a multiline text box and an option button for Text alignment (Left, Right And centre). Can anyone give me suggestions as to change the style of the textbox.

    Currently I am killing the textbox using "Control Kill" and then creating the new text box using "Control Add" with the modified properties. Is there some other way to do it.


    -------------
    Anand Kumar
    An&

  • #2
    Take a look in the source code Forum, seems someone posted such code before...

    ------------------
    Scott Turchin


    Scott Turchin
    MCSE, MCP+I
    http://www.tngbbs.com
    ----------------------
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

    Comment


    • #3
      In general terms:

      Some control styles are dynamically adjustable (use GetWindowLong() and SetWindowLong() with the %GWL_STYLE flag), but other styles are only able to be set at control creation time.

      For styles that fit the latter case, your approach of destroying and recreating the control is the only possible method.

      In summary: the technique used depends on the style bits you want to change.



      ------------------
      Lance
      PowerBASIC Support
      mailto:[email protected][email protected]</A>
      Lance
      mailto:[email protected]o.nz

      Comment


      • #4
        If to beleive books, it's not possible to change ES_CENTER / ES_LEFT / ES_RIGHT after creation.

        ------------------

        Comment


        • #5
          ...it's not possible to change ES_CENTER / ES_LEFT / ES_RIGHT after creation.
          Unless you create your own custom edit box by super-classing the standard Windows edit control, and take appropriate action when the WM_STYLECHANGED message is received.

          ------------------
          If you try to make something idiot-proof, someone will invent a better idiot.

          Comment

          Working...
          X