Get selected text in a mdi child

E

Elmo Watson

I have an MDI app -
the main control in the one MDIchild form is a RichTextBox
in the form load event of one of the forms I call/show, I want to grab the
selected text in the Rich Textbox

I've tried:
With DirectCast(ActiveMdiChild, frmMyForm)
label4.text=.RTB1.seltext
end with
But I get an error: Object reference not set to an instance of an object.

I tried
Dim f as new form
f=DirectCast(ActiveMdiChild, frmMyForm)
and then tried it, but it doesn't recognize any controls in the
activeMDIchild...

How can I do this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,265
Latest member
TodLarocca

Latest Threads

Top