Click here to Skip to main content
15,895,011 members
Home / Discussions / C#
   

C#

 
GeneralRe: File System Watcher Pin
Mohamad Al Husseiny7-Aug-05 8:30
Mohamad Al Husseiny7-Aug-05 8:30 
GeneralRe: File System Watcher Pin
cmarmr7-Aug-05 9:46
cmarmr7-Aug-05 9:46 
QuestionDelete last row from a datagrid bound to an arraylist, without getting index out of range when picking another row afterwards.? Pin
spAAwn7-Aug-05 5:51
spAAwn7-Aug-05 5:51 
GeneralA text control that responds to the event when "Enter" key is pressed Pin
shahzadbahi7-Aug-05 2:38
shahzadbahi7-Aug-05 2:38 
GeneralRe: A text control that responds to the event when "Enter" key is pressed Pin
Mohamad Al Husseiny7-Aug-05 6:03
Mohamad Al Husseiny7-Aug-05 6:03 
GeneralRe: A text control that responds to the event when "Enter" key is pressed Pin
nidhelp7-Aug-05 15:04
nidhelp7-Aug-05 15:04 
GeneralRe: A text control that responds to the event when "Enter" key is pressed Pin
Rob Graham7-Aug-05 16:41
Rob Graham7-Aug-05 16:41 
GeneralRe: A text control that responds to the event when "Enter" key is pressed Pin
Mohamad Al Husseiny7-Aug-05 21:02
Mohamad Al Husseiny7-Aug-05 21:02 
nidhelp wrote:
i want to do something like u.. when the user press "enter" after keying in some information in the textbox, it'll open something for display, for my case it's opening a tab page..

i tried the method above but it cant work.. i donno why..

my button is button3, textbox is textBox4 and it will open a tab page called tabPage6


you can modify the code above to do what you want
the code did not work because -i think- the tabcontrol not the next control to textbox i mean if textbox tabindex=7 the tabcontrol should be 8
you can do somthing like that
private void Text_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if(e.KeyChar==(char)13)
			{
			
    			//this.GetNextControl(textBox1,true).Focus();
				tabControl1.Focus();
				tabControl1.SelectedTab=tabPage2;
				e.Handled=true;
			}

		}


nidhelp wrote:
btw what does (char)13 mean in >> if(e.KeyChar==(char)13) ?
why is there a 13 and must i use it in my program too?


as rob said this the value of enterkey as this numric value and KeyChar type is Char so we need to cast it
in other word convert numric value to char
one of the method to do that is
(char)13 which wil do the conversion

if you want to know the value of other key
look at
Keys Enumeration[^]


MCAD
GeneralRe: A text control that responds to the event when "Enter" key is pressed Pin
nidhelp7-Aug-05 22:42
nidhelp7-Aug-05 22:42 
GeneralRe: A text control that responds to the event when "Enter" key is pressed Pin
Mohamad Al Husseiny7-Aug-05 22:50
Mohamad Al Husseiny7-Aug-05 22:50 
GeneralRe: A text control that responds to the event when "Enter" key is pressed Pin
nidhelp7-Aug-05 23:47
nidhelp7-Aug-05 23:47 
GeneralRe: A text control that responds to the event when "Enter" key is pressed Pin
Mohamad Al Husseiny8-Aug-05 0:41
Mohamad Al Husseiny8-Aug-05 0:41 
GeneralRe: A text control that responds to the event when "Enter" key is pressed Pin
nidhelp9-Aug-05 15:44
nidhelp9-Aug-05 15:44 
GeneralRe: A text control that responds to the event when "Enter" key is pressed Pin
Mohamad Al Husseiny10-Aug-05 11:59
Mohamad Al Husseiny10-Aug-05 11:59 
GeneralSerialze/Deserialize mixed xml elements Pin
michaelreian6-Aug-05 18:53
michaelreian6-Aug-05 18:53 
GeneralRe: Serialze/Deserialize mixed xml elements Pin
Guffa7-Aug-05 0:03
Guffa7-Aug-05 0:03 
GeneralRe: Serialze/Deserialize mixed xml elements Pin
michaelreian7-Aug-05 0:21
michaelreian7-Aug-05 0:21 
GeneralRe: Serialze/Deserialize mixed xml elements Pin
Guffa7-Aug-05 2:24
Guffa7-Aug-05 2:24 
Questiong.DrawString to display floating point? Pin
...---...6-Aug-05 16:15
...---...6-Aug-05 16:15 
AnswerRe: g.DrawString to display floating point? Pin
Rob Graham6-Aug-05 16:41
Rob Graham6-Aug-05 16:41 
GeneralRe: g.DrawString to display floating point? Pin
...---...7-Aug-05 7:54
...---...7-Aug-05 7:54 
GeneralRe: g.DrawString to display floating point? Pin
Rob Graham7-Aug-05 8:14
Rob Graham7-Aug-05 8:14 
AnswerRe: g.DrawString to display floating point? Pin
Sebrell6-Aug-05 17:04
Sebrell6-Aug-05 17:04 
GeneralWhen Public isnt really Public Pin
MrEyes6-Aug-05 8:57
MrEyes6-Aug-05 8:57 
GeneralRe: When Public isnt really Public Pin
Judah Gabriel Himango6-Aug-05 15:05
sponsorJudah Gabriel Himango6-Aug-05 15:05 

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.