Click here to Skip to main content
15,921,452 members
Home / Discussions / C#
   

C#

 
QuestionPreventing File Creation Pin
Shanila12327-Dec-05 1:15
Shanila12327-Dec-05 1:15 
AnswerRe: Preventing File Creation Pin
Rob Philpott27-Dec-05 2:09
Rob Philpott27-Dec-05 2:09 
QuestionOn line help Pin
mipooo27-Dec-05 0:57
mipooo27-Dec-05 0:57 
QuestionExtended Textbox Pin
Greeky26-Dec-05 23:57
Greeky26-Dec-05 23:57 
AnswerRe: Extended Textbox Pin
cbhkenshin27-Dec-05 0:03
cbhkenshin27-Dec-05 0:03 
GeneralRe: Extended Textbox Pin
peshkunta27-Dec-05 0:17
peshkunta27-Dec-05 0:17 
GeneralRe: Extended Textbox Pin
Greeky27-Dec-05 2:34
Greeky27-Dec-05 2:34 
GeneralRe: Extended Textbox Pin
peshkunta27-Dec-05 3:03
peshkunta27-Dec-05 3:03 
I understand that, but you need to have KeyPreview = true; to be able to assign the AcceptButton property to a button for it to work without any extra code. (If the KeyPreview property is set to false, your case will only work if the only control on the Form is the button.)

This is part of the code and it doesn't include the Form initialization where you need to put KeyPreview = true;

This is all you need to be able to let's say write something in a textfield, press ENTER and even if your text still has focus it will work.
But if you don't have the KeyPreview set to true, it will not.


//**********************************************
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ButtonPressedCsharpDELETETHIS
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
textBox1.Text = "Button is pressed";
}
}
}
//*******************************************

-- Don't worry about the world coming to an end today. It's already tomorrow in Australia --

GeneralRe: Extended Textbox Pin
Greeky27-Dec-05 3:07
Greeky27-Dec-05 3:07 
GeneralRe: Extended Textbox Pin
fregolo5223-Mar-06 23:13
fregolo5223-Mar-06 23:13 
QuestionWHAT DIFFRENCE THERE IS BETWEEN WIN XP AND WIN2000 SP4 SO THAT A WINDOWS APPLICATION IS GETTING AFFECTED AND DONT FUNCTION THE WAY IT DO WELL IN XP??!!! Pin
cbhkenshin26-Dec-05 23:31
cbhkenshin26-Dec-05 23:31 
AnswerRe: WHAT DIFFRENCE THERE IS BETWEEN WIN XP AND WIN2000 SP4 SO THAT A WINDOWS APPLICATION IS GETTING AFFECTED AND DONT FUNCTION THE WAY IT DO WELL IN XP??!!! Pin
leppie27-Dec-05 0:12
leppie27-Dec-05 0:12 
GeneralRe: WHAT DIFFRENCE THERE IS BETWEEN WIN XP AND WIN2000 SP4 SO THAT A WINDOWS APPLICATION IS GETTING AFFECTED AND DONT FUNCTION THE WAY IT DO WELL IN XP??!!! Pin
cbhkenshin27-Dec-05 0:21
cbhkenshin27-Dec-05 0:21 
AnswerRe: WHAT DIFFRENCE THERE IS BETWEEN WIN XP AND WIN2000 SP4 SO THAT A WINDOWS APPLICATION IS GETTING AFFECTED AND DONT FUNCTION THE WAY IT DO WELL IN XP??!!! Pin
User 665827-Dec-05 3:33
User 665827-Dec-05 3:33 
Questionhelp regarding redirecting consol I/O in c# app. Pin
musmanafzal26-Dec-05 23:30
musmanafzal26-Dec-05 23:30 
QuestionRegarding calling Event Pin
A.Grover26-Dec-05 23:13
A.Grover26-Dec-05 23:13 
AnswerRe: Regarding calling Event Pin
Rob Philpott26-Dec-05 23:28
Rob Philpott26-Dec-05 23:28 
GeneralRe: Regarding calling Event Pin
peshkunta27-Dec-05 3:28
peshkunta27-Dec-05 3:28 
Questionproblem displaying text in a textBox Pin
zt.Prog26-Dec-05 23:03
zt.Prog26-Dec-05 23:03 
AnswerRe: problem displaying text in a textBox Pin
Rob Philpott26-Dec-05 23:15
Rob Philpott26-Dec-05 23:15 
GeneralRe: problem displaying text in a textBox Pin
zt.Prog26-Dec-05 23:34
zt.Prog26-Dec-05 23:34 
GeneralRe: problem displaying text in a textBox Pin
Rob Philpott26-Dec-05 23:47
Rob Philpott26-Dec-05 23:47 
GeneralRe: problem displaying text in a textBox Pin
zt.Prog27-Dec-05 0:04
zt.Prog27-Dec-05 0:04 
GeneralRe: problem displaying text in a textBox Pin
Rob Philpott27-Dec-05 0:18
Rob Philpott27-Dec-05 0:18 
GeneralRe: problem displaying text in a textBox Pin
zt.Prog27-Dec-05 1:25
zt.Prog27-Dec-05 1:25 

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.