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
__________________
.dk
Advertisements. Register and be a member of the community to get rid of them.
Re: A small problem while using Common dialog in VB 6
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.