Create two buttons that interact with an editbox


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Create two buttons that interact with an editbox

  1. #1
    Join Date
    Jul 2005
    Posts
    17

    Arrow Create two buttons that interact with an editbox

    Hi all I hope in an answer that could help me about my problem because I'm going crazy.
    I'm creating a GUI in Visual C++ .NET and I'd like to split the "Spin Control" in two buttons.

    I created an editbox with a spin, only to test the code, and the result is this:


    Here the code that I wrote:
    The spin control:
    CSpinButtonCtrl *spin = (CSpinButtonCtrl*)GetDlgItem(IDC_SPIN_ROTOR_TEST);
    spin->SetRange(0, 25);
    spin->SetPos(0);
    GetDlgItem(IDC_ROTORTEXT)->SetWindowText("A");
    The letters in the editbox:
    void CTestDlg::onShowposSpinStr(NMHDR* pNMHDR, LRESULT* pResult)
    {
    int nNewPos;
    char szNumber[][16] =
    {
    "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "W", "V", "X", "Y", "Z"
    };
    NM_UPDOWN *pNMUpDown = (NM_UPDOWN*) pNMHDR;

    nNewPos = pNMUpDown->iPos + pNMUpDown->iDelta;

    if(nNewPos >= 0 && nNewPos <= 25)
    {
    GetDlgItem(IDC_ROTOR3TEXT)->SetWindowText(szNumber[nNewPos]);
    }
    *pResult = 0;
    }
    But now I have to split the spin into two buttons that interact with the editbox, to increase/decrease the letters, like this:


    I have no idea on how I can do this...
    Please someone help me, I'm desperate.
    Last edited by Arkanops; 07-09-2005 at 11:56 AM.

  2. #2
    Join Date
    Jul 2005
    Posts
    17
    No idea?!
    :( :( :(

  3. #3
    Join Date
    Dec 2003
    Posts
    3,366
    I know there is a spin control already in VS -- its under active x stuff --
    not sure about your version.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center