Home » VB.Net

Input mode on inputbox


Can i change the input mode width InputModeEditor.SetInputMode for an inputbox? I need to take only numbers from an inputbox.

Best regards.


7 Answers Found


Answer 1

Hi Imanligenc ,

Please check this :



Hope this will help you.


Answer 2

Or maybe you could use as you want


But not sure if it allows to set the input mode for the InputBox. If not, you could consider to create your own

modal dialog containing a textbox.


Answer 3

By input box, i assume you mean TextBox? You can use the InputModeEditor on your TextBox.


Something like this:

InputModeEditor.SetInputMode(yourTextBoxControl, InputMode.Numeric)


This by the way only works on the Smartphone (also known as Windows Mobile Standard) platform


Answer 4

I mean inputbox() function. And the InputModeEditor.SetInputMode can't be used on an inputbox.

Answer 5

Have you seen this:



Christopher Fairbairn made a customized version of an InputBox that you might find interesting. You can get it here:



Answer 6

InputModeEditor.SetInputMode(textBox1, InputMode.Numeric);

But this will not work in case of Pocket PC (Touch Based phones) Only for Smart Phones

You may cretae your own method for this check whether textbox have numeric or alphabets in it like this

private bool CheckNumeric(string number)
            bool flag = true;
            for (int i = 0; (i < number.Length) && (flag == true); i++)
                char[] temp2 = number.Substring(i, 1).ToCharArray();
                char[] temp3 = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
                if (temp2[0].Equals(temp3[0]) || temp2[0].Equals(temp3[1]) || temp2[0].Equals(temp3[2]) || temp2[0].Equals(temp3[4]) || temp2[0].Equals(temp3[5]) || temp2[0].Equals(temp3[6]) || temp2[0].Equals(temp3[3]) || temp2[0].Equals(temp3[7]) || temp2[0].Equals(temp3[8]) || temp2[0].Equals(temp3[9]))
                    flag = true;
                    flag = false;
                    i = number.Length;
            return flag;


Answer 7

thanks for your answers.


This is probably a question that comes up a lot.  I've seen some posts related to it that suggest that it may exist, but they are either vague or they are describing the error highlighting language services.  I've never seen it working myself.

Will Intellipad ship with language services that provide the ability to add text completion/suggestion (like VS) and/or syntax highlighting in the Input Window when you are in DSL Grammar Mode?  I see that the input window has error highlighting, which is different from the syntax highlighting (typically in blue for keywords like 'Class' or 'Integer') I'm talking about.  If it will, does any of this functionality work in the November CTP?  Is there any syntactic magic I need to apply to my .mg file to get it to work?

Something like this would be very useful so that people who arn't fluent in my DSL (everyone else but me) can have a good experience while coding in it.

Documentation references,  links to blog entries, or links to other forum posts talking about this would also be appreciated.




I am developing an application in windows phone 7 that supports both orientation.I have a textbox in my application.

When i change the orientation from portrait to landscape the input keyboard does not work fine in landscape mode.

I have one more issue in my app.I am using webbrowser control inside scrollviewer.I am now able to scroll but the scrollbar is not visible.Can i make it visible?

Can you please help me in this?

Thanks in advance.

Hi, i am trying to change input panel mode to numeric when my textbox got focus, but nothing is working for me, completly no effect.
I have already tried this solutions:

Process p = Process.GetCurrentProcess();


SendMessage(p.MainWindowHandle, Tapi.EM_SETINPUTMODE, 0, Tapi.EIM_NUMBERS);


InputModeEditor.SetInputMode(textBox, InputMode.Numeric);
(i also tried above solutions with [DllImport("coredll")] public static extern int GetFocus() insted of p.MainWindowHandle, but without success)

But nothing is working! I put this code into my OnGotFocus method which is called after textBox received focus, so why it is not working?

I need your help. I am working on this for two days now.


I'm making an application for Windows Mobile 6 smartphone using VS 2008 in C#. There's this textbox where I want the inputmode to change automatically to numeric mode. But I'm having problems doing so. I've tried InputModeEditor.SetInputMode(this.textBox1, InputMode.Numeric) but it gives the error "the name InputModeEditor does not exist in the current context". I assume it's because it needs the Microsoft.WindowsCE.Forms but when I use it I get "Error 6 The type or namespace name 'WindowsCE' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)". (if I missing and assembly reference I don't know how or where to add it).


InputModeEditor should only work for smartphone projects right? Well I'm pretty sure I'm doing one! "Windows Mobile 6 Standard Device" right?

Anyone has any ideas? Maybe without using InputModeEditor or something. I'm still a newbie when it comes to mobile applications.


I was wondering if there is a Input Box available for WP7 (Modal dialog with text box and Okay button)? I like the MessageBox.Show animation and I was wondering if the same is available with the a textbox in it.




Good Morning

I am attempting to do, what I thought, an easy task. All I want to do is increase the size of the input box in SmallSearchInputBox. I played with every class under the universe and finially noticed that in the rendered html there is an inline stype setting the width to 170px. How can I change this?




I'm trying to set up a file where I copy a template to additional worksheets as needed using a macro.  I have a data file I use for pivot tables which I would like the macro to link a specific range from the newly created worksheet to the data file.  I tried to set up an input box so I could pick the specific worksheet I want to reference in the formula for the data file, but am getting errors on this line:   ActiveCell.FormulaR1C1 = "='Sheets(mySht)'!R[15]C"

Any guidance on how I can have the active cell on the data file reference a worksheet name of my selection within a formula?



myShts = ActiveWorkbook.Sheets.Count
    For i = 1 To myShts
    myList = myList & i & " - " & ActiveWorkbook.Sheets(i).Name & " " & vbCr
    Next i
    Dim mySht As Single
    mySht = InputBox("Select sheet to go to." & vbCr & vbCr & myList)

    Sheets("Template").Copy Before:=Sheets(6)
    Sheets("Data File").Select
    Selection.Insert Shift:=xlDown
    ActiveCell.FormulaR1C1 = "='Sheets(mySht)'!R[15]C"
End Sub


I'm developing a form so when you click on one of the buttons an input box comes up and prompt the user to insert a date. Now the box comes up with 2 buttons on it an "OK" and a "Cancel". I would like when the user click "OK" after inserting the date to go to the next form, and when the user click "Cancel" to exit and return to the original form. I know how to do all that, but what's preventing me is i don't know what is the return value when the user click on "OK" or "Cancel" in order for me to finish my code? Microsoft help for "InputBox" doesn't mention a return value for "OK" or "Cancel".

Here's my code, and thanks in advance:

Private Sub MenuOp_Click()

Dim tbl As Recordset, RecDate As Variant, cnt As Long, recd As Variant, intx As Integer, response As Variant


If Len(Nz(Me!StaList)) > 0 And Len(Nz(Me!TypeList)) > 0 And Len(Nz(Me!PosList)) > 0 Then
        cnt = 0
                If cnt = 3 Then
                    MsgBox ("3 Incorrect Entries!!! Form will reset")
                        Me.StaList = ""
                        Me.TypeList = ""
                        Me.PosList = ""
                        Me.MenuOp = 0
                        GoTo MoveOn
                End If
        RecDate = InputBox("Please Enter the date using this format: mm/dd/yyyy", "Enter Date",Date)
                If Len(Nz(RecDate)) = 0 Then
                    response = MsgBox("Date entry cannot be blank. Do you wish to continue?", vbYesNo + vbInformation + vbDefaultButton1, "Blank Field")
                            'MsgBox (response)
                            If response = vbYes Then
                                cnt = cnt + 1
                                GoTo Repeat
                                Me.StaList = ""
                                Me.TypeList = ""
                                Me.PosList = ""
                                Me.MenuOp = 0
                                GoTo MoveOn
                            End If
                ElseIf Not IsDate(RecDate) Then
                    MsgBox (" '" & RecDate & "' " & " is not a proper date")
                       cnt = cnt + 1
                       GoTo Repeat
                    GoTo Continue
                    'MsgBox ("I'm Here")
                End If
                Set tbl = CurrentDb.OpenRecordset("Inspection_Data", dbOpenDynaset)
                tbl!Sub = Me!StaList
                tbl!EquipType = Me!TypeList
                tbl!Pos = Me!PosList
                tbl!Label = recd
                tbl!DateOfService = RecDate
                DoCmd.OpenForm "Inspection_Data_Form", , , "[SUB]= '" & Me!StaList & "' And [EquipType]= '" & Me!TypeList & "' And [Pos]= '" & Me!PosList & "' And [Label]= '" & recd & "'", acFormEdit
                GoTo MoveOn



How do you make an Inputbox without a title?

I know you can do it this way:

inputbox("Please answer a question", " ", "")

This way you put a space in the Title property.

But is there another way to do this without putting a space in the Title property?

Maybe there is an inputbox without a title in vb.net?

Thanks in advance!





Office 2010, VBA for Excel, Windows XP

The following Excell VBA code is causing me a lot of frustration.  I'm hoping someone out there can help set me straight.

1st concern: When a user presses "Cancel", why do I get "Error 424"?  How do I avoid or handle this?

2nd concern: When the input field is blank and the user clicks on "OK" Excel shows a warning box regarding an error in a formula and won't proceed until either a cell is picked or "Cancel" is clicked.  I haven't found a way to handle this so the user doesn't see it or have to deal with this warning.  I'm hoping that it's possible!

If I can get an explanation of what VBA is doing/thinking, it will certainly help my understanding.

This code is the only code in Sheet1.

Sub test()
Dim response1 As Range
On Error GoTo ErrorHandler
Set response1 = Application.InputBox(prompt:="Pick a cell.", Type:=8)
If response1 Is Nothing Then
    MsgBox ("Nothing Choosen")
    MsgBox (response1.Address)
End If
Exit Sub

MsgBox (Err.Number)
Resume Next
End Sub


I received the following error:

Run time error '91':
Object variable or With block variable not set

For the following macro -

Sub FineMe()
Dim myValue As String
myValue = InputBox("Please enter your search criteria")
    ActiveSheet.Cells.Find(What:=myValue, _
    After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlWhole, _
    SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
    False, SearchFormat:=False).Activate
End Sub

When I reviewed the macro the myValue did indicate that it held the input value.

Why am I getting this error?
Thank you



When my macro runs, I need it to prompt the user with 2 choices (like a listbox). The values will be hardcoded in the macro as this is for setting up the header/footer.

I can't find any sample on the usage of Inputbox with Type:=64. I'm not sure if I'm using the right control tool. Is there listbox available ?


Please advise. TIA !


Hi there,

I have done DataGridRowValidaiton like this:

     InputValidationRule rule = new InputValidationRule(mGrid);

            rule.ValidatesOnTargetUpdated = false;

            rule.ValidationStep = ValidationStep.RawProposedValue;

this only runs the validate function when the input gets commited. I want the validation to occur while user is entering input. 




I have a simple workflow that creates opportunities. It is on demand and runs on the Account entity.

Is there a way for the user to input say the Topic for the opportunities that are created when each one runs the workflow?

All of our salespeople will run this workflow and we'd like each user to enter in their own topic/subject line.





I have a custom transform with two inputs.  Since only one of them requires a GUI, I'd like to use the default Advanced Editor to select input columns.  How can I call the Advanced Editor UI for a named input?


Hello all,

is it possible to use any of the Windows libraries for audio devices to get the exact number of input channels for a soundcard which has multiple inputs -- say, for instance, 8?
(Eventually, I will also need to capture audio coming on a specific channel of a specific soundcard)
I am working with Windows XP and Visual C++.

Thank you in advance!
AC Grama.

I have a userform where the user inputs information into textboxes, and then hits a command button, which sends the information from the various textboxes to different columns in an Excel sheet.  The code works fine, except for a textbox where the user will input a number.  for that box, the textbox sends the number to the sheet as text, not as a number.

I have tried various ways to fix this, and have put my "solutions" in different places in the code, but nothing has worked so far.  Should I be using something besides a textbox?  Is there a way to have the text be sent as a number?  After the userform sends the number to Excel as text, Excel immediately recognizes the problem and puts up a little exclamation point with a notice that a number has been entered as text and gives the option to covert it, but of course I'd rather have the number entered as a number in the first place.  If anyone has any ideas, I'd appreciate it.  Thanks!

I am running Vista (Excel 2007).


This question is similar to a previous question I asked on this board.  There, I had a userform textbox where I needed Excel to interpret user input as a number instead of text.

The only difference now is that I need Excel to interpret the input from a textbox as a date rather than a number.  It's the same situation: the user inputs a date into a textbox and then a command button sends that information to a cell.

The solution to the last question was:

If IsNumeric(Me.TextBox1.Value) Then
  Range("Whatever").Value = Val(Me.TextBox1.Value)
  MsgBox Me.TextBox1.Value & " is not a valid number"
End If

I tried that with "IsDate" instead of "IsNumeric," but apparently that's not a real thing because it inputs the date as the number "1."  If anyone has any ideas, I'd appreciate it - thanks!

computer boot to normal mode with no problem. but normal services arent running. checked msconfig, it indicated that almost all of the services are stopped. tried using services.msc, they are set to automatic but when i try to start a service, it gives me a pop up saying that i cant do it on the safe mode. i verified that the computer is running on normal mode. i also checked the boot.ini file and it was set to normal. there are no checks on safe boots on msconfig's boot.ini tab. anyone encountered this kind of problem? 

by the way, i went to safe mode with networking, services running on it is similar with the services running on the normal mode. 



Can anyone please let me know whats the difference between edit mode and publish mode of a page in Sharepoint 2007?

Reason why I am asking this question is, there is a web part and field controls which are developed to use AJAX, they work fine in edit mode only but not in publish mode.



<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure