Can i add button with a function in c#? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can i add button with a function in c#?

Please tell me code for how to add button in c# which should perform a specified activity when clicked please help!

5th Aug 2020, 7:53 AM
Black Coder...
Black Coder... - avatar
5 Answers
+ 4
You need GUI. 1) Select the Button from the gui components(drag and drop) 2) give it an ID to make it later functional using c# codes. 3) Now go to your mainActivity.cs and call that button gui element using the ID that you've given in step 2. edit: call that gui button with its ID and put a onclick function on it
5th Aug 2020, 7:57 AM
Rohit
+ 3
GUI stands for Graphical User Interface. So GUI are those Button, Slider etc that we see in our mobile apps everyday. Yes, you will be needing an IDE for dragging and dropping a GUI components.
5th Aug 2020, 8:05 AM
Rohit
+ 2
RKK what is GUI is it an IDE
5th Aug 2020, 8:02 AM
Black Coder...
Black Coder... - avatar
+ 2
RKK Thanks for help i'll check
5th Aug 2020, 8:06 AM
Black Coder...
Black Coder... - avatar