Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

common dialog does not auto refresh its file list view

Status
Not open for further replies.

Cubitus

Programmer
Aug 2, 2004
2
DE
In my application I have a preferences dialog callable by the main form's menu. On the preferences form there's a button for selecting the app's log file.
I'm using a common dialog control for that task and found a strange behaviour on WinXP:
[ul]
[li]the dialog allows to create new folders
[green][smile] OK[/green][/li]
[li]the dialog allows to delete folders/files
[green][smile] OK[/green][/li]
[li]newly created folders are invisible within the dialog's file list view until the user presses F5 to refresh the view
[red][sad] Not as in other programs on same computer[/red][/li]
[li]deleted folders/files will not vanish within the dialog's file list view until the user presses F5 to refresh the view
[red][sad] Not as in other programs on same computer[/red][/li]
[/ul]

It does not seem to matter if the preferences form is modal or modeless.

Code:
Private Sub cmdAGLogFile_Click()
  Dim fsoTmp As New Scripting.FileSystemObject
  Me.dlgFile.flags = cdlOFNExplorer Or cdlOFNHideReadOnly
  Me.dlgFile.DefaultExt = ".log"
  Me.dlgFile.Filter = ""
  Me.dlgFile.InitDir = fsoTmp.GetParentFolderName(Me.txtAGLogFile.text)
  Me.dlgFile.FileName = fsoTmp.GetFileName(Me.txtAGLogFile.text)
  Me.dlgFile.DialogTitle = "Select Log File"

  On Error Resume Next
  Err.Clear
  Me.dlgFile.ShowSave
  If Err.number = 0 Then
    Me.txtAGLogFile.text = Me.dlgFile.FileName
  End If
  
End Sub

Any hints how I could get the (seems so) default behaviour of the common dialog in my app, too?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top