Click here to Skip to main content
15,889,391 members
Home / Discussions / C#
   

C#

 
GeneralRe: Read, write and processing each row of a gridview ? Pin
Member 245846724-Nov-15 22:49
Member 245846724-Nov-15 22:49 
GeneralRe: Read, write and processing each row of a gridview ? Pin
Simon_Whale24-Nov-15 22:55
Simon_Whale24-Nov-15 22:55 
GeneralRe: Read, write and processing each row of a gridview ? Pin
Member 245846725-Nov-15 15:00
Member 245846725-Nov-15 15:00 
QuestionC# app as proxy Pin
Member 1206160023-Nov-15 0:12
Member 1206160023-Nov-15 0:12 
AnswerRe: C# app as proxy Pin
OriginalGriff23-Nov-15 0:37
mveOriginalGriff23-Nov-15 0:37 
AnswerRe: C# app as proxy Pin
Rob Philpott25-Nov-15 1:19
Rob Philpott25-Nov-15 1:19 
GeneralRe: C# app as proxy Pin
Member 1206160025-Nov-15 1:38
Member 1206160025-Nov-15 1:38 
GeneralRe: C# app as proxy Pin
Rob Philpott25-Nov-15 1:51
Rob Philpott25-Nov-15 1:51 
GeneralRe: C# app as proxy Pin
Member 120616003-Dec-15 20:35
Member 120616003-Dec-15 20:35 
Questioncan anyone suggest best books or links for C# interview Pin
Gowtham Gururaj22-Nov-15 17:49
Gowtham Gururaj22-Nov-15 17:49 
AnswerRe: can anyone suggest best books or links for C# interview PinPopular
Pete O'Hanlon22-Nov-15 19:22
mvePete O'Hanlon22-Nov-15 19:22 
AnswerRe: can anyone suggest best books or links for C# interview Pin
OriginalGriff22-Nov-15 21:56
mveOriginalGriff22-Nov-15 21:56 
AnswerRe: can anyone suggest best books or links for C# interview Pin
F-ES Sitecore22-Nov-15 22:25
professionalF-ES Sitecore22-Nov-15 22:25 
AnswerRe: can anyone suggest best books or links for C# interview Pin
Mycroft Holmes23-Nov-15 1:35
professionalMycroft Holmes23-Nov-15 1:35 
AnswerRe: can anyone suggest best books or links for C# interview Pin
Amarnath S23-Nov-15 2:43
professionalAmarnath S23-Nov-15 2:43 
AnswerRe: can anyone suggest best books or links for C# interview Pin
Rob Philpott23-Nov-15 4:48
Rob Philpott23-Nov-15 4:48 
GeneralRe: can anyone suggest best books or links for C# interview Pin
Mycroft Holmes23-Nov-15 13:11
professionalMycroft Holmes23-Nov-15 13:11 
GeneralRe: can anyone suggest best books or links for C# interview Pin
OriginalGriff23-Nov-15 22:23
mveOriginalGriff23-Nov-15 22:23 
GeneralRe: can anyone suggest best books or links for C# interview Pin
Rob Philpott23-Nov-15 23:54
Rob Philpott23-Nov-15 23:54 
GeneralRe: can anyone suggest best books or links for C# interview Pin
Pete O'Hanlon24-Nov-15 0:05
mvePete O'Hanlon24-Nov-15 0:05 
AnswerRe: can anyone suggest best books or links for C# interview Pin
Gerry Schmitz23-Nov-15 7:01
mveGerry Schmitz23-Nov-15 7:01 
QuestionHow to set TextBox to only accept numbers? Pin
naouf1021-Nov-15 7:34
naouf1021-Nov-15 7:34 
I have already checked other questions here but the answers are not related to my issue. the following code allows textbox1 to only accept numbers if the physical keyboard (laptop) is pressed:

private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
char ch = e.KeyChar;
if ( !char.IsDigit(ch))
{

e.Handled = true;
}
}

but this is not what I wanted (I dont use physical laptop keyboard).


I have windows form with buttons and a textbox1. I designed keyboard and it works well but I want textbox1 to only accept numbers and the ".".

There are only two lines of code inside each button (and only code in the project) which is:

private void buttonName_Click(object sender, EventArgs e)
{
// each button only has this code.

textBox1.Focus();
SendKeys.Send(buttonName.Text);
}

I know how to set textbox to accept numbers if the physical (laptop ) keys are pressed but here in this case I have windows form with control buttons ( each button to print its text into textbox1) and I want to set textBox1 to only accept numbers and the ".". Please help in how to achieve this. Thank you
AnswerRe: How to set TextBox to only accept numbers? Pin
Gerry Schmitz21-Nov-15 11:38
mveGerry Schmitz21-Nov-15 11:38 
AnswerRe: How to set TextBox to only accept numbers? Pin
Gilbert Consellado21-Nov-15 16:25
professionalGilbert Consellado21-Nov-15 16:25 
AnswerRe: How to set TextBox to only accept numbers? Pin
BillWoodruff21-Nov-15 18:43
professionalBillWoodruff21-Nov-15 18:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.