Loading ...
Sorry, an error occurred while loading the content.

RE: [wtl] Problem attaching CUpDownCtrl to a CEdit control

Expand Messages
  • Ilker Aksen
    Hi, Did you check the order of controls on your dialog resource ? Updown control must come after your edit control in order to use autobuddy. Regards, Ilker
    Message 1 of 3 , Feb 7, 2003
    • 0 Attachment
      Hi,
      Did you check the order of controls on your dialog resource ? Updown
      control must come after your edit control in order to use autobuddy.

      Regards,

      Ilker

      -----Original Message-----
      From: Hiu Sing Ngai [mailto:hiusing@...]
      Sent: Friday, February 07, 2003 5:14 AM
      To: wtl@yahoogroups.com
      Subject: [wtl] Problem attaching CUpDownCtrl to a CEdit control


      Hello guys,

      I would like to place a edit control with a CUpDownCtrl attached in a
      View. However, I can't make the UpDownCtrl attach to a edit control
      even I set the edit ctrl buddy to CUpDownCtrl. The UpDownCtrl looks
      like on the top of the edit control but disapper after the edit control
      got the focus. The UpDownCtrl is very to use on a dialog box and it
      will be arrange to fit in a edit control. How to attach a updownctrol
      to a edit control and also how to do it without setting the updownctrl's
      position?

      // public member
      CUpDownCtrl m_udSpacingHorz;
      CEdit m_wndSpacingHorz;

      // OnCreate
      m_wndEdit.Create(m_hWnd, rcDefault, _T(""), WS_CHILD | WS_VISIBLE |
      ES_LEFT, WS_EX_CLIENTEDGE); m_ud.Create(m_hWnd, rcDefault, _T(""),
      WS_CHILD | WS_VISIBLE | UDS_ALIGNRIGHT);
      m_ud.SetBuddy(m_wndSpacingHorz); m_ud.SetRange(-100000, 100000);
      m_ud.SetPos(0);

      // UpdateLayout
      m_wndEdit.MoveWindow(x, nOffset, EDIT_WIDTH, m_nHeight);
      m_ud.MoveWindow(x + (EDIT_WIDTH - UPDOWNCTRL_WIDTH), nOffset,
      UPDOWNCTRL_WIDTH, m_nHeight);

      Thanks,
      H.S.Ngai


      [Non-text portions of this message have been removed]



      To unsubscribe from this group, send an email to:
      wtl-unsubscribe@yahoogroups.com



      Your use of Yahoo! Groups is subject to
      http://docs.yahoo.com/info/terms/
    • Bill Arnette
      I am confused, you declare: CEdit m_wndSpacingHorz; But then create: // OnCreate m_wndEdit.Create(m_hWnd, rcDefault, _T( ), WS_CHILD | WS_VISIBLE | ES_LEFT,
      Message 2 of 3 , Feb 7, 2003
      • 0 Attachment
        I am confused, you declare:
        CEdit m_wndSpacingHorz;

        But then create:
        // OnCreate
        m_wndEdit.Create(m_hWnd, rcDefault, _T(""), WS_CHILD | WS_VISIBLE | ES_LEFT,
        WS_EX_CLIENTEDGE);
        ^^^^^^^^^
        Should this be m_wndSpacingHorz?

        And then set the buddy:
        m_ud.SetBuddy(m_wndSpacingHorz);
        ^^^^^^^^^^^^^^^^
        or should this be m_wndEdit?



        -----Original Message-----
        From: Hiu Sing Ngai [mailto:hiusing@...]
        Sent: Thursday, February 06, 2003 11:14 PM
        To: wtl@yahoogroups.com
        Subject: [wtl] Problem attaching CUpDownCtrl to a CEdit control


        Hello guys,

        I would like to place a edit control with a CUpDownCtrl attached in a View.
        However, I can't make the UpDownCtrl attach to a edit control even I set the
        edit ctrl buddy to CUpDownCtrl. The UpDownCtrl looks like on the top of the
        edit control but disapper after the edit control got the focus. The
        UpDownCtrl is very to use on a dialog box and it will be arrange to fit in a
        edit control. How to attach a updownctrol to a edit control and also how to
        do it without setting the updownctrl's position?

        // public member
        CUpDownCtrl m_udSpacingHorz;
        CEdit m_wndSpacingHorz;

        // OnCreate
        m_wndEdit.Create(m_hWnd, rcDefault, _T(""), WS_CHILD | WS_VISIBLE | ES_LEFT,
        WS_EX_CLIENTEDGE);
        m_ud.Create(m_hWnd, rcDefault, _T(""), WS_CHILD | WS_VISIBLE |
        UDS_ALIGNRIGHT);
        m_ud.SetBuddy(m_wndSpacingHorz); // <---- shouldn't the param be
        m_WndEdit?
        m_ud.SetRange(-100000, 100000); m_ud.SetPos(0);

        // UpdateLayout
        m_wndEdit.MoveWindow(x, nOffset, EDIT_WIDTH, m_nHeight);
        m_ud.MoveWindow(x + (EDIT_WIDTH - UPDOWNCTRL_WIDTH), nOffset,
        UPDOWNCTRL_WIDTH, m_nHeight);

        Thanks,
        H.S.Ngai


        [Non-text portions of this message have been removed]


        ------------------------ Yahoo! Groups Sponsor ---------------------~--> Get
        128 Bit SSL Encryption!
        http://us.click.yahoo.com/LIgTpC/vN2EAA/xGHJAA/saFolB/TM
        ---------------------------------------------------------------------~->

        To unsubscribe from this group, send an email to:
        wtl-unsubscribe@yahoogroups.com



        Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      Your message has been successfully submitted and would be delivered to recipients shortly.