Click here to Skip to main content
15,566,522 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
someone help me with this?

I'm migrating from VB.NET to C# but I'm trying something like this

Form.RichTextBox.loadfile("File")

but it's not working

What I have tried:

I tried to research about and tried to create a separate class from the form
Posted
Updated 20-Mar-22 19:18pm
Comments
Richard MacCutchan 21-Mar-22 4:48am    
"but it's not working"
What does that mean? Does the file load, does it get displayed in the textbox ... ?
Hawk2811 21-Mar-22 9:50am    
I need that in the other form it executes this code in this form

example

I have form1 but in form2 this will be executed for form1 to open the text file

1 solution

Get rid of the Form part of the line. You only need the control instance name and the method name, in the correct character case. C# is case sensitive. Oh, and a semi-colon on the end of the line.
C#
RichTextBox1.LoadFile("filepath");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900