howto handle browse folder,open,save dialog |
Post Reply |
Author | |
Developerx
Groupie Joined: 03 March 2011 Status: Offline Points: 12 |
Post Options
Thanks(0)
Posted: 13 June 2012 at 7:05pm |
Hello all, I was just in a mode to share some tips howto use CJ commondialog 3 important things i found after testing open with cj commondialog filters, parenthwnd, and capture if user click cancel instead of OK. 1. important use the parentHWND, look in code ; ) ---------------------------------------------------------------------------------- ' EXAMPLE ' EXAMPLE how to choose a file CommonDialog1.ParentHwnd = Me.hWnd 'set filters CommonDialog1.Filter = "html (.html)|.html|" & "htm (*.htm)|*.htm|" _ & "text (*.txt)|*.txt|" & "JPEG (*.jpg)|*.jpg|" & "ALL (*.*)|*.*|" whataction = CommonDialog1.ShowOpen filex = CommonDialog1.FileName 'this must come after showsave If whataction = 2 Then Me.Caption = "Cancel..." Else Me.Caption = "Ready" 'send result to flatedit1 FlatEdit1.Text = filex End If End Sub 'Example howto browsefolder correct whataction = CommonDialog1.ShowBrowseFolder filex = CommonDialog1.FileName 'this must come after showsave ' Me.Caption = CommonDialog1.FileName If whataction = 2 Then Me.Caption = "Cancel..." Else Me.Caption = "Ready" FlatEdit2.Text = filex End If End Sub Example in use |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |