Home All Groups Group Topic Archive Search About

How to hide the numericUpDown control's up and down arrows?

Author
5 Jul 2006 3:35 PM
ABC
How to hide the numericUpDown control's up and down arrows?

I only want the numeric textbox, but numericUpDown has up and down arrow is
not my want, how can I hide it?
Author
5 Jul 2006 5:47 PM
Jared Parsons [MSFT]
Hello ABC,

> How to hide the numericUpDown control's up and down arrows?
>
> I only want the numeric textbox, but numericUpDown has up and down
> arrow is not my want, how can I hide it?

I don't think that you can hide the arrows on the NumericUpDown control. 

--
Jared Parsons [MSFT]
jared***@online.microsoft.com
All opinions are my own. All content is provided "AS IS" with no warranties,
and confers no rights.
Are all your drivers up to date? click for free checkup

Author
5 Jul 2006 9:20 PM
Bob Powell [MVP]
Just use a text box!

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.



Show quoteHide quote
"ABC" <a**@abc.com> wrote in message
news:%230mDyiEoGHA.4848@TK2MSFTNGP03.phx.gbl...
> How to hide the numericUpDown control's up and down arrows?
>
> I only want the numeric textbox, but numericUpDown has up and down arrow
> is not my want, how can I hide it?
>
Author
6 Jul 2006 4:55 AM
ABC
but if I use textbox, it will accept any non-numeric characters.

Show quoteHide quote
"Bob Powell [MVP]" <bob@_spamkiller_.bobpowell.net> ¼¶¼g©ó¶l¥ó·s»D:OFj%23ajHoGHA.4***@TK2MSFTNGP02.phx.gbl...
> Just use a text box!
>
> --
> Bob Powell [MVP]
> Visual C#, System.Drawing
>
> Ramuseco Limited .NET consulting
> http://www.ramuseco.com
>
> Find great Windows Forms articles in Windows Forms Tips and Tricks
> http://www.bobpowell.net/tipstricks.htm
>
> Answer those GDI+ questions with the GDI+ FAQ
> http://www.bobpowell.net/faqmain.htm
>
> All new articles provide code in C# and VB.NET.
> Subscribe to the RSS feeds provided and never miss a new article.
>
>
>
> "ABC" <a**@abc.com> wrote in message
> news:%230mDyiEoGHA.4848@TK2MSFTNGP03.phx.gbl...
>> How to hide the numericUpDown control's up and down arrows?
>>
>> I only want the numeric textbox, but numericUpDown has up and down arrow
>> is not my want, how can I hide it?
>>
>
>
Author
6 Jul 2006 2:57 PM
Claes Bergefall
Public Class TextBoxEx
    Inherits TextBox
    Private Const ES_NUMBER As Integer = &H2000

    Protected Overrides ReadOnly Property CreateParams() As
System.Windows.Forms.CreateParams
        Get
            Dim params As CreateParams = MyBase.CreateParams
            params.Style = params.Style Or ES_NUMBER
            Return params
        End Get
    End Property

    Protected Overrides Function ProcessCmdKey(ByRef msg As
System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys) As
Boolean
        If keyData = (Keys.Shift Or Keys.Insert) OrElse keyData =
(Keys.Control Or Keys.V) Then
            Dim data As IDataObject = Clipboard.GetDataObject
            If data Is Nothing Then
                Return MyBase.ProcessCmdKey(msg, keyData)
            Else
                Dim text As String =
CStr(data.GetData(DataFormats.StringFormat, True))
                If text = String.Empty Then
                    Return MyBase.ProcessCmdKey(msg, keyData)
                Else
                    For Each ch As Char In text.ToCharArray
                        If Not Char.IsNumber(ch) Then
                            Return True
                        End If
                    Next
                    Return MyBase.ProcessCmdKey(msg, keyData)
                End If
            End If
        Else
            Return MyBase.ProcessCmdKey(msg, keyData)
        End If
    End Function
End Class

  /claes

Show quoteHide quote
"ABC" <a**@abc.com> wrote in message
news:OdFHxhLoGHA.1244@TK2MSFTNGP05.phx.gbl...
> but if I use textbox, it will accept any non-numeric characters.
>
Author
16 Jan 2009 5:57 AM
Rajesh
Author
12 Jun 2009 11:41 AM
Deepa
numupdown.controls[0].Hide() From http://www.google.co.in/search?hl=en&client=firefox-a&rls=org.mozilla:en-US:official&hs=KpM&q=hide+Numericupdown+arrows&btnG=Search&meta= Posted via DevelopmentNow.com Groups http://www.developmentnow.com/g/

Bookmark and Share