So, my problem is that I want to get the selected item on the combobox as string and use it in another method. Is that possible ? And how?
|
C#
Combobox variable |
(Dec 11, 2016 04:10 AM)DucaRii Wrote: So, my problem is that I want to get the selected item on the combobox as string and use it in another method. Is that possible ? And how? Maybe using Text property? PHP Code Side note: switch can be also used (Dec 11, 2016 09:07 AM)Vinnilia Wrote: That my friend is very simple. Ayyy thank you bro. Could you also tell me how to send the string "value" to, for example, the main function (Dec 11, 2016 11:12 AM)DucaRii Wrote: Ayyy thank you bro. Could you also tell me how to send the string "value" to, for example, the main function PHP Code You are welcome
Dec 11, 2016 11:40 AM
(This post was last modified: Dec 11, 2016 11:41 AM by DucaRii.)
(Dec 11, 2016 11:24 AM)Zilog80 Wrote: Code void mainfunction()Would this work ?
Dec 11, 2016 01:11 PM
(This post was last modified: Dec 11, 2016 01:12 PM by mrkoolaid.)
how about instead of an if statement..
Code if (combo.Text == "Windows")you should switch it up :) Code switch(combo.Text.ToLower())it scales better :)
Dec 11, 2016 04:18 PM
(This post was last modified: Dec 11, 2016 04:29 PM by ๖ۣۜDiViN3.)
The method:
PHP Code Calls the method: PHP Code (Dec 11, 2016 11:40 AM)DucaRii Wrote: You obviously dont even know the basics of programming so I suggest you learn those first. (Dec 11, 2016 11:40 AM)DucaRii Wrote: Meh, replace the two function lines with this: PHP Code
Dec 13, 2016 09:54 AM
(This post was last modified: Dec 13, 2016 10:06 AM by newmecha.)
PHP Code PHP Code PHP Code I think the code is pretty self explaintory if not let me know and I can explain it. Lol and I'm high fuh cause I didn't read he want's the string to use in another method. Can still do that by calling the .Name lol added that in . |
|
|

