how can i put a selected word from textbox into string or label?


Active member
Feb 23, 2014
Programming Experience
hi.. how can i do that things?
exmple i have textbox or richtextbox that contain this:


int main();
int a,b;
int c;

printf("Enter two numbers: ");
scanf("%d, %d", &a,&b);

c = a + b;

printf("The sum of two numbers is: %d", c);


i want the int a,b; and int c; put into a label or string.. but i dont know how to do that.. plss help.
When you select some text in a TextBox or RichTextBox control, you can access that text in code via the control's SelectedText property. That property already is a String, so you don't have to put anything anywhere. If you want to display any text in a Label then you assign a String containing that text to the Label's Text property.
Top Bottom