| View previous topic :: View next topic |
| Author |
Message |
Sneak Grandmaster Cheater Supreme
Reputation: 0
Joined: 05 Nov 2008 Posts: 1895
|
Posted: Sun Dec 13, 2009 11:32 am Post subject: [C#] ListBox |
|
|
I have an injector ive made, and everything works fine. I just would like to have whatever is selected in ListBox2 to appear in textBox1.
Ive tried ListBox2.SelectedItem = textBox1.text; No error, but it doesnt work when I double click it and it wont show up in textbox.
Please and thanks
_________________
|
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Sun Dec 13, 2009 2:45 pm Post subject: |
|
|
It might have something to do with the fact you don't quite know how '=' works...
Might....
|
|
| Back to top |
|
 |
Sneak Grandmaster Cheater Supreme
Reputation: 0
Joined: 05 Nov 2008 Posts: 1895
|
Posted: Sun Dec 13, 2009 2:57 pm Post subject: |
|
|
ive used = before lol. and it isnt a bool statement, so no need for the '=='.
_________________
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Sun Dec 13, 2009 4:04 pm Post subject: |
|
|
| a = b assigns a as the value of b.. have a think
|
|
| Back to top |
|
 |
hacksign23 Master Cheater
Reputation: 0
Joined: 26 Nov 2006 Posts: 404
|
Posted: Mon Dec 14, 2009 3:43 am Post subject: |
|
|
text goes first.
you wrote ListBox2.SelectedItem = textBox1.text
it's supposed t be
textBox1.text == ListBox2.SelectedItem
_________________
|
|
| Back to top |
|
 |
LolSalad Grandmaster Cheater
Reputation: 1
Joined: 26 Aug 2007 Posts: 988 Location: Australia
|
Posted: Mon Dec 14, 2009 5:32 am Post subject: |
|
|
| hacksign23 wrote: | text goes first.
you wrote ListBox2.SelectedItem = textBox1.text
it's supposed t be
textBox1.text == ListBox2.SelectedItem |
Now you're bringing about more confusion. He wants | Code: | | textBox1.text = ListBox2.SelectedItem; |
_________________
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Mon Dec 14, 2009 8:13 am Post subject: |
|
|
| Wahoa wrote: | | hacksign23 wrote: | text goes first.
you wrote ListBox2.SelectedItem = textBox1.text
it's supposed t be
textBox1.text == ListBox2.SelectedItem |
Now you're bringing about more confusion. He wants | Code: | | textBox1.text = ListBox2.SelectedItem; |
|
huh?!
when did i write that i'm a faggot?!
and for the topic
another thing is
textbox1.Text = listBox1.Items[listBox1.SelectedIndex].ToString();
|
|
| Back to top |
|
 |
hacksign23 Master Cheater
Reputation: 0
Joined: 26 Nov 2006 Posts: 404
|
Posted: Mon Dec 14, 2009 11:51 pm Post subject: |
|
|
HAHA it's a siggy that mods can use.
it shows the viewer's username there.
don't worry.
and yea. ToString() is probably necessary. I have bad memory.
And oops my bad.
I have no idea why I put ==.
_________________
|
|
| Back to top |
|
 |
WaffleMaster Grandmaster Cheater Supreme
Reputation: 0
Joined: 19 Oct 2006 Posts: 1237
|
Posted: Sat Dec 19, 2009 7:47 pm Post subject: textBox1.text = ListBox2.SelectedItem;[/code] |
|
|
| Code: | | textBox1.Text = (string)ListBox1.SelectedItem; |
much easier
and the assignment operator basically does the same thing as it does in math
_________________
Problem, CEF?
Buying zhelms/leech in Windia. PM me. |
|
| Back to top |
|
 |
|