0

I need to to send variables between two forms in the same project is that possible ??
also can I change the color of some text in text box but not the whole the text ??
Thanks in advance

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by alaa sam
1

1-To send variable from one form to another just declare public variable in the target form and set it in the instance
2-no you cannot you will need to use richtextbox

0

how to do the first one ? can you give me an example?
I'm using richtextbox , so can I change the color of only one word for example??

0

issue1

Form1:Form
{
public int dataToHere;
}
Form2:Form
{
void test()
{
Form1 obj=new Form1();
obj.dataToHere=10;
}
}

issue2

richTextBox1.SelectionStart = 0;
richTextBox1.SelectionLength= 3;
richTextBox1.SelectionColor = Color.Red;
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.