NumericUpDown Select All? How can I do this?

Is there a way I can select all in a numericupdown As in cause it all to be highlight/selected

I'm assuming this is a PInvoke

Thanks!




Answer this question

NumericUpDown Select All? How can I do this?

  • Thorben

    Check out this link. This should help you out.

  • Nagaraju Somisetty

    In .NETCF v2, the Handle propery on the NUD control returns the hwnd of the edit control portion.

    On v1, using the Capture trick to get the hwnd, you are likely getting the hwnd of the wrapper control. You will need to P/Invoke to GetWindow(hwnd, GW_CHILD) and GetWindow(hwnd, GW_HWNDNEXT) to find the hwnd of the edit portion. PInvoke to GetClassName. When you find one named "Edit", you are there.



  • steve paul

    Make sure the control has focus then send the message.

    if (!this.Focused)
    this.Focus();
    IntPtr ret = SendMessage(this.Handle, SETSEL, start, length);

  • TheRata

    It was writen using VS2005 and .NETCF2.0 so won't work in VS2003.  You can take the same concept and convert it to be compatible with VS2003.  Basically the core of it is SendMessage and EM_SETSEL.

    Mark Arteaga
    .NET Compact Framework MVP

    http://www.opennetcf.com | http://blog.markarteaga.com

     


  • Fuqiang Dai

    How can I determine the handle of the owning control

    I was using Capture to get the Hwnd.

    Is there a better technique for doing this

    Thanks!



  • mp5k

    Odd, still nothing. I can send other messages to the control. I wonder what gives with this message.

    Any more ideas

    Thanks again!



  • Alek Davis

    Hey, ... Thanks for the link.

    I can't get this to work using .NET CF 1 SP3. (VS 2003 ). Any idea why this is When I add the binaries as references to the app, i'm told they aren't .net binaries.

    Any ideas Thanks again, appreciate this...



  • PaulWong

    Sorry, so broken down a little more...

    If the name of my control was numericUD... how would I do this... I get the PInvoke end of it, if just not familiar with the API.

    Thanks!



  • Robert Kok

    I believe the NUD is a compound control composed of several windows (edit, spinner buttons, etc.). Those may all be wrapped in another "owning" control. Make sure you are sending your SETSEL message to the edit control part of the NUD.

  • RajST

    You are a gentleman and a scholar.


    THANKS AGAIN! It Worked!



  • paolog

    Whats odd is I keep sending that message with SET SEL 0x00B1 and nothing.

    Any ideas what could/would prevent the message from taking

    Thanks!



  • NumericUpDown Select All? How can I do this?