error in using richtexBox1.text property [Resolved]

Posted by Sudhakar_A under C# on 9/23/2013 | Points: 10 | Views : 874 | Status : [Member] | Replies : 2
Why it is giving error while using richtextBox1.Text in the above code
error:-Non -invocable member 'System.Windows.Forms.Control.Text' cannot be used like an method
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if (port.IsOpen)
{


port.Write(secondpacket, 0, secondpacket.Length);

richTextBox1.Clear();
richTextBox1.Text("Request for download packet is send.......");

System.Threading.Thread.Sleep(10000);
log.Info("Requestdownload is send successfully");
}




Responses

Posted by: Bandi on: 9/23/2013 [Member] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
if (port.IsOpen) 

{
port.Write(secondpacket, 0, secondpacket.Length);

richTextBox1.Clear();
richTextBox1.Text = "Request for download packet is send.......";

System.Threading.Thread.Sleep(10000);
log.Info("Requestdownload is send successfully");
}


Please look into the highlighted part.. You are trying to use Text as method name ; but that is only the property of RichTextBox....
So I corrected that part....

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Sudhakar_A, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 9/24/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down

if (port.IsOpen)

{
port.Write(secondpacket, 0, secondpacket.Length);
richTextBox1.Clear();
richTextBox1.AppendText("Request for download packet is send.......");

System.Threading.Thread.Sleep(10000);
log.Info("Requestdownload is send successfully");
}


Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Sudhakar_A, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response