Click here to Skip to main content
15,910,234 members
Home / Discussions / C#
   

C#

 
QuestionC# Living or Phazing out? Pin
Xentinel19-Jul-04 21:53
Xentinel19-Jul-04 21:53 
AnswerRe: C# Living or Phazing out? Pin
Michael P Butler19-Jul-04 22:15
Michael P Butler19-Jul-04 22:15 
AnswerRe: C# Living or Phazing out? Pin
Colin Angus Mackay19-Jul-04 22:45
Colin Angus Mackay19-Jul-04 22:45 
GeneralRe: C# Living or Phazing out? Pin
eggie520-Jul-04 9:17
eggie520-Jul-04 9:17 
GeneralRe: C# Living or Phazing out? Pin
Colin Angus Mackay20-Jul-04 11:02
Colin Angus Mackay20-Jul-04 11:02 
QuestionDisabling addition of new rows in DataGrid? Pin
Radoslav Bielik19-Jul-04 20:52
Radoslav Bielik19-Jul-04 20:52 
AnswerSolution :-) Pin
Radoslav Bielik19-Jul-04 21:22
Radoslav Bielik19-Jul-04 21:22 
Generalassigning data to a TextBox in HandlerEvent Pin
Stephan Wright19-Jul-04 20:50
Stephan Wright19-Jul-04 20:50 
Hy everyone!

I know I already posted a lot of questions. I hope I did not anoy anyone of you, but I am very new to C#, trying to get along with my C/C++ knowledge, but C# is different in some ways. I also do have the MSDN to look up some things, but I don't know why, because if I do not know for sure what to look for (a class e.g.) then I feel lost in there .....
On the otherhand I should have finished a special task (a programm) at the end of August ....

Well but back to my question:

I do want to assign a field of an array of strings to a TextBox (the TextBox is called lTextBox in there and the field I want to assign is called ltemparray[1]).

The relevant code looks like this.
......
// definition
TextBox lTextBox = sender_txtNameKeyDragDrop as TextBox;
....
// part of the ContextMenu definition
menuItem1.Index=0;
menuItem1.Text=ltemparray[1].ToString();
menuItem1.Click += new System.EventHandler(this.menuItem1_Click);
.....
// display contextmenu for the TextBox
ctNameKeyMenu.Show(lTextBox, lTextBox.PointToClient(Cursor.Position));

.....

private void menuItem1_Click(object sender_menuItem1Click, System.EventArgs e_menuI1C)
{
// assign data to TextBox in here
}

But the problem is: how do I get the TextBox. Well I do think I have to adress it via the parent, but I am not quit sure.
So if anyone of you could tell me what the lines of code to assign the string in the arrayelemnt to the TextBox (in the Click event) has to look like, it would help me a lot.

And besides I guess I would learn a lot! Smile | :)

Thanks!
Stephan.
Generalfound a solution :-) Pin
Stephan Wright19-Jul-04 23:04
Stephan Wright19-Jul-04 23:04 
Generalvery urgent. about audio mixers Pin
karpurapu_z19-Jul-04 20:37
karpurapu_z19-Jul-04 20:37 
GeneralGlobal variables and ViewState Pin
Alex Getman19-Jul-04 20:12
Alex Getman19-Jul-04 20:12 
GeneralRe: Global variables and ViewState Pin
Syed Abdul Khader20-Jul-04 4:08
Syed Abdul Khader20-Jul-04 4:08 
Generaledit box display formatting Pin
RonBou19-Jul-04 19:10
RonBou19-Jul-04 19:10 
Generalinpout32.dll Pin
ahmedadelfarid19-Jul-04 18:57
ahmedadelfarid19-Jul-04 18:57 
Generalurgent ! handling multiple data tables in a dataset Pin
sharpX19-Jul-04 18:40
sharpX19-Jul-04 18:40 
GeneralRe: urgent ! handling multiple data tables in a dataset Pin
Heath Stewart20-Jul-04 9:49
protectorHeath Stewart20-Jul-04 9:49 
QuestionHow can I display 2 forms, one after the other? Pin
arik_a19-Jul-04 18:08
arik_a19-Jul-04 18:08 
AnswerRe: How can I display 2 forms, one after the other? Pin
MKlucher19-Jul-04 18:28
MKlucher19-Jul-04 18:28 
GeneralRe: How can I display 2 forms, one after the other? Pin
arik_a19-Jul-04 22:47
arik_a19-Jul-04 22:47 
QuestionHow to realize Web control's context menu by c# Pin
nakey_yang19-Jul-04 17:18
nakey_yang19-Jul-04 17:18 
AnswerRe: How to realize Web control's context menu by c# Pin
Nick Parker19-Jul-04 17:29
protectorNick Parker19-Jul-04 17:29 
GeneralVery Urgent Please -- Overloading ++ operator doesn't function as intended. Pin
Member 112523619-Jul-04 17:12
Member 112523619-Jul-04 17:12 
GeneralRe: Very Urgent Please -- Overloading ++ operator doesn't function as intended. Pin
Javier Lozano19-Jul-04 18:06
Javier Lozano19-Jul-04 18:06 
GeneralRe: Very Urgent Please -- Overloading ++ operator doesn't function as intended. Pin
Heath Stewart20-Jul-04 10:04
protectorHeath Stewart20-Jul-04 10:04 
GeneralBinary Data over network Pin
joelwwk19-Jul-04 17:11
joelwwk19-Jul-04 17:11 

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.