Click here to Skip to main content
15,892,674 members
Home / Discussions / C#
   

C#

 
AnswerRe: ClientRectangle in VS 2005 Pin
Insincere Dave7-Mar-06 13:39
Insincere Dave7-Mar-06 13:39 
QuestionIssue using a Treeview to control a listview Pin
digicd17-Mar-06 7:44
digicd17-Mar-06 7:44 
QuestionKeyPress event Pin
JoeSox7-Mar-06 7:43
JoeSox7-Mar-06 7:43 
AnswerRe: KeyPress event Pin
Judah Gabriel Himango7-Mar-06 10:16
sponsorJudah Gabriel Himango7-Mar-06 10:16 
GeneralRe: KeyPress event Pin
JoeSox7-Mar-06 12:14
JoeSox7-Mar-06 12:14 
GeneralRe: KeyPress event Pin
Judah Gabriel Himango8-Mar-06 3:50
sponsorJudah Gabriel Himango8-Mar-06 3:50 
GeneralRe: KeyPress event Pin
JoeSox8-Mar-06 7:27
JoeSox8-Mar-06 7:27 
GeneralRe: KeyPress event Pin
Judah Gabriel Himango8-Mar-06 7:34
sponsorJudah Gabriel Himango8-Mar-06 7:34 
Simply calling the OnKeyPress protected method inside the TextBox derivative control will fire the KeyPress event in the underlying control. So, to raise the KeyPress event:

// Inside your TextBox derivative:
public void ManuallyRaiseKeyPress(...)
{
    base.OnKeyPress(...);
}

// Outside the TextBox derivative
myTextBoxDerivative.ManuallyRaiseKeyPress(...);


Keep in mind that this will NOT insert text into the control. The KeyPress event responds to a key being pressed on the keyboard. The text box does not insert text into the control when it receives the KeyPress event; on the contrary, the KeyPress event responds to text being inserted via the keyboard. If you're still sure that's what you want, the above solution should work for you.

Now, if you're trying to insert text into the textbox programmatically, and textBox.Text = ... won't work for you, then you're going to need to use either SendKeys or SendMessage (win32) to the textbox. SendKeys should work so long as the actual textbox is focused (in your original code posting, you were focusing the user control, not the textbox).
QuestionCSharp/VBCodeProvider.Parse Pin
Ed.Poore7-Mar-06 6:54
Ed.Poore7-Mar-06 6:54 
QuestionMonitor LAN activity Pin
Stefano Alini7-Mar-06 6:46
Stefano Alini7-Mar-06 6:46 
AnswerRe: Monitor LAN activity Pin
Judah Gabriel Himango7-Mar-06 7:58
sponsorJudah Gabriel Himango7-Mar-06 7:58 
QuestionRead large text files with c# Pin
MrWeiland7-Mar-06 6:13
MrWeiland7-Mar-06 6:13 
AnswerRe: Read large text files with c# Pin
Werdna7-Mar-06 6:49
Werdna7-Mar-06 6:49 
GeneralRe: Read large text files with c# Pin
MrWeiland7-Mar-06 21:41
MrWeiland7-Mar-06 21:41 
AnswerRe: Read large text files with c# Pin
Guffa7-Mar-06 6:54
Guffa7-Mar-06 6:54 
GeneralRe: Read large text files with c# Pin
MrWeiland7-Mar-06 21:57
MrWeiland7-Mar-06 21:57 
AnswerRe: Read large text files with c# Pin
Guffa7-Mar-06 23:16
Guffa7-Mar-06 23:16 
GeneralRe: Read large text files with c# Pin
MrWeiland8-Mar-06 0:08
MrWeiland8-Mar-06 0:08 
AnswerRe: Read large text files with c# Pin
JoeSox7-Mar-06 7:51
JoeSox7-Mar-06 7:51 
GeneralRe: Read large text files with c# Pin
MrWeiland7-Mar-06 21:43
MrWeiland7-Mar-06 21:43 
GeneralRe: Read large text files with c# Pin
JoeSox8-Mar-06 3:28
JoeSox8-Mar-06 3:28 
GeneralRe: Read large text files with c# Pin
hackerhcm7-Mar-06 23:44
hackerhcm7-Mar-06 23:44 
GeneralRe: Read large text files with c# Pin
JoeSox8-Mar-06 3:25
JoeSox8-Mar-06 3:25 
QuestionHow to get the real Length(size) of UTF8 String? Pin
pmasknguyen7-Mar-06 5:56
pmasknguyen7-Mar-06 5:56 
AnswerRe: How to get the real Length of UTF8 String? Pin
Dario Solera7-Mar-06 5:57
Dario Solera7-Mar-06 5:57 

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.