|
-
September 17th, 2001, 02:01 PM
#1
Problem with Common Dialog Control
I am having a problem using the Filter property of the common dialog control. When I try to add a filter, i get the following compile error "Invalid use of property"
Is there any reason for this? does the filter property have to be set in the Form_Load event?
This is what I have:
private Sub cmdOpenFile_Click()
on error resume next
CommonDialog1.Filter "FoxPro Programs (*.prg)|*.prg"
CommonDialog1.ShowOpen
me.txtFileName = CommonDialog1.FileName
me.lstPrgFiles.AddItem (CommonDialog1.FileName)
End Sub
Thanks!
~goddess
[email protected]
"There are no stupid questions, but there are a lot of inquisitive idiots."
-
September 17th, 2001, 02:17 PM
#2
Re: Problem with Common Dialog Control
The problem I believe is not in Filter but in the line
me.lstPrgFiles.AddItem (CommonDialog1.FileName)
if you use CommonDialog1.FileName
then you will get the message - invalid use of property
try the following
r = CommonDialog1.FileName
me.lstPrgFiles.AddItem r
Iouri Boutchkine
[email protected]
-
September 17th, 2001, 02:36 PM
#3
Re: Problem with Common Dialog Control
I tried your suggestion, but I still get the same error on the filter property.
Is there anything else I can try?
~goddess
[email protected]
"There are no stupid questions, but there are a lot of inquisitive idiots."
-
September 17th, 2001, 02:38 PM
#4
Re: Problem with Common Dialog Control
Maybe it is just a type error. I found you missed '='.
CommonDialog1.Filter = "FoxPro Programs (*.prg)|*.prg"
Regards,
Michi
-
September 17th, 2001, 02:43 PM
#5
Re: Problem with Common Dialog Control
Thanks! This worked great.
~goddess
[email protected]
"There are no stupid questions, but there are a lot of inquisitive idiots."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|