PDA

Click to See Complete Forum and Search --> : please help with user control


Gandor
Nov 25th, 1999, 11:45 AM
I created a simple user control with a richtextbox in it

now how on earth do i get the control to act like a richtextbox and let me open a file in it?

[This message has been edited by Gandor (edited 11-26-1999).]

Mark Sreeves
Nov 25th, 1999, 02:47 PM
You need to add a Public Sub to the userControl which maps to the Richtextbox

eg. in the usercontrol:


Public Sub LoadFile(strFile As String)
RichTextBox1.LoadFile strFile
End Sub



then in the client program:


Private Sub Command1_Click()
UserControl11.LoadFile "C:\test.rtf"
End Sub



Does this help?


------------------
Mark Sreeves
Analyst Programmer

Mark.Sreeves@Softlab.co.uk
A BMW Group Company


[This message has been edited by Mark Sreeves (edited 11-26-1999).]