A small problem while using Common dialog in VB 6

Status
Not open for further replies.

deepak.krishnan

In the zone
Hello friends
This is the code given in MDI form:
Code:
Private Sub mnuopen_Click()
cd.Filter = "AllFiles|*.txt"
FileName = cd.FileName
cd.ShowOpen
frmmain.Caption = cd.FileName
End Sub

The problem is that when I select a file in the open dialog box and try to open it does not display the file in a textbox given in a child form of the MDI application
 

redhat

Mad and Furious
There is no line of code that asks d program 2 display the contents in a text box!!!
 

abhijangda

Padawan
The first problem my friend UFO007 is that u r using Text Box instead u should use Rich Text Box. Go to Components from project menu then find Microsoft Rich Text Box SP4 and check it. Change its name to rtb. To open file type the following statement for button "mnuopen".
Private Sub mnuopen_Click()
cd.DefaultExt = "*.txt"
cd.Filter = "All Files|*.txt"
cd.ShowOpen
rtb.FileName = cd.FileName
frmmain.Caption = cd.FileName
End Sub
Copy and Paste the following code then open any file. Remember here rtb is used for RichTextBox, cd is used for common dialog and you can open only txt,rtf or doc file or html file to view its code (these all are tested by me in my own Notepad). If this problem is not solved then post here and I can give u my NotePad+ which is created by me.
 
Status
Not open for further replies.
Top Bottom