Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to find a string like in Notepad.

Status
Not open for further replies.

abidmunirmalik

Programmer
Mar 17, 2003
4
US
Hi there,

I am trying to make a simple Notepad in VB.Net.

I have one main form and i have a Rich Text Box on it.
Now when user click on Edit-->Find , a new small window appear(Form) same like in Notepad we see.

Now when i click on FindNext Button it will not take me to the main form where i have my Rich Text Box.

I thouhgt frmFind has no idea about frmMain, so i declare a object of type frmMain and i open it in FindNext Button Click event.

Now it is opening a brand new frmMain with no text on it.

I am confuse here, like in Visual Basic if you want to refer a control of another form, you simple say OtherForm.Control.Property But here it is not working like that.

i am new to VB.Net so i dont know how to handle this in VB.Net .

can anyone give me any suggestion what should i do to accomplish this.

Thanks for any of your suggestions.

Regards
Abid
 
Forget VB6. In VB6, the App kept an implicit (hidden) default object reference for each Form Class. Each object reference had the same name as the Form Class and was defined as
Public formname as New formname

The New was "delayed" in that the form class was not instantiated until it was referenced. In VB.Net, there is no default instance of a form class. If you want to refer to an instance of a frmMain then you will have to access a variable that contains a reference to the instamce of frmMain that you created. While you are IN frmMain, ME contains a reference to the THIS instance of frmMain.

Forms/Controls Resizing/Tabbing Control
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top