|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to hide the numericUpDown control's up and down arrows?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? Hello ABC,
> How to hide the numericUpDown control's up and down arrows? I don't think that you can hide the arrows on the NumericUpDown control. > > I only want the numeric textbox, but numericUpDown has up and down > arrow is not my want, how can I hide it? -- 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. Just use a text box!
-- Show quoteHide quoteBob 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? > 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? >> > > 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. > put this in your code
numericUpDown1.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/ 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/
Other interesting topics
ToolStripProgressBar and InvokeRequired - again
.NET 2.0 and System.Configuration.ApplicationSettingsBase Authentication between windows application and SQL server How to reduce the padding/margin of DataGridView cells? User input focus detecting? How to resize combobox? ListView exception InvokeRequired incorrect on Form close/dispose contextMenuStrip with TreeNodes Download file - error 406 |
|||||||||||||||||||||||