Announcement

Collapse
No announcement yet.

Setting width of "msctls_updown32" control?

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

  • Setting width of "msctls_updown32" control?

    Hi all,
    I want to create an up-down control, using this statement:

    CONTROL ADD "msctls_updown32", hForm1&, %FORM1_UPDOWN1, "", 32, 17, 9, 12, _
    %WS_CHILD OR %WS_VISIBLE OR %UDS_ALIGNRIGHT OR %UDS_SETBUDDYINT

    This works, but I want to increase its size: both height and width.
    I can change the height, but the width remains the same, even by changing to
    something like this:
    CONTROL ADD "msctls_updown32", hForm1&, %FORM1_UPDOWN1, "", 32, 17, 30, 30, _
    %WS_CHILD OR %WS_VISIBLE OR %UDS_ALIGNRIGHT OR %UDS_SETBUDDYINT

    So I suspect that I have to set the width by using SendMessage or something.
    I couldn't find anything about it on the internet though...
    Somebody know how?

    Kind regards
    Eddy

    ------------------
    [email protected]
    Eddy

  • #2
    For clarity:
    I copied the "Control Add"-line out of a POFFS example just now, cause I didn't
    have my source code with me right now.
    I don't need the updown control to be a 'buddy'! It's a stand alone control.
    So this statement would be more appropriate:

    CONTROL ADD "msctls_updown32", hForm1&, %FORM1_UPDOWN1, "", 32, 17, 9, 12, _
    %WS_CHILD OR %WS_VISIBLE

    Kind regards
    Eddy



    ------------------
    [email protected]
    Eddy

    Comment


    • #3
      Going from memory (I'm not at my DEV PC right now), when you use the "setbuddy" flag, the control auto-sizes itself based on the size of the control it is 'attached' to. You can easily verify this by resizing the other control.

      You could try using SetWindowPos() or CONTROL SET SIZE to resize the control after it has been created and initialized.

      I seem to remember that you can also use the UpDown control without attaching it to another control - it will mean you'll have to handle the buddy functionality yourself though.

      Can I ask why you want to resize the control? It is hard to imagine a situation where this would be beneficial without breaking the GUI "design convention rules" (unless this is a stand-alone control).

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

      Comment


      • #4
        Originally posted by Lance Edmonds:
        Can I ask why you want to resize the control? It is hard to imagine a situation where this would be beneficial without breaking the GUI "design convention rules" (unless this is a stand-alone control).
        [/B]
        Hi Lance,
        Late up at night?
        I don't want to change the control size during runtime. I just want a big updown control!
        And when creating the control (CONTROL ADD) I can only seem to set the
        control's height, not the width. That's my problem...

        Eddy

        ------------------
        [email protected]
        Eddy

        Comment


        • #5
          Originally posted by Lance Edmonds:
          You could try using SetWindowPos() or CONTROL SET SIZE to resize the control after it has been created and initialized.
          "CONTROL SET SIZE" does the job Lance! I was totally focused on the
          parameters of the CONTROL ADD statement that I overlooked the obvious.
          As always: thanks for your (instantaneous!) help!

          Kind regards
          Eddy



          ------------------
          [email protected]
          Eddy

          Comment


          • #6
            Always glad to help.

            Nope, not up late (yet!)... I telecommute from New Zealand, and it's only around 9:30pm here at the moment.

            However, I am a night owl, so you'll often see me here in the middle of the night (NZ time).



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

            Comment

            Working...
            X