Results 1 to 8 of 8

Thread: Common Dialog Flags?

  1. #1
    Guest
    How do you have multi flags?

    Code:
    CommonDialog1.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
    CommonDialog1.Flags = cdlOFNHideReadOnly
    CommonDialog1.Flags = cdlOFNOverwritePrompt
    CommonDialog1.ShowSave
    This code only takes the last flag so the Over Write Prompt works, but the Read Only part is still there.

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Use the OR opertator:
    CommonDialog1.Flags = cdlOFNHideReadOnly or cdlOFNOverwritePrompt
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    The plus (+) operator will also work here (you can "add" all the desired flags):

    Code:
    CommonDialog1.Flags = cdlOFNHideReadOnly + cdlOFNOverwritePrompt
    "It's cold gin time again ..."

    Check out my website here.

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    that may work but when you have flags that interfere like:
    vbthisflag=3 (1+2)
    vbthatflag=1 (1)
    you will get 4 which could be a totally different flag
    1 + 3 = 4
    if you use or it will skip all interfering flags:
    1 or 3 = 3
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    Junior Member
    Join Date
    Dec 1999
    Posts
    25

    Cool multiple dlg flags

    I have searched all of vb help that comes with 5.0 and from what I can tell there is no way at all to have multiple flags. Maybe if u check the microsoft, vb website and search their knowledge database. If u find an answer please send this way too.

  6. #6
    Guest
    Where does it say that?

    Kedaman's method would probably work.

  7. #7
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Flags are always an amount of boolean switches:
    &H1
    &H2
    &H4
    &H8
    &H10
    &H20
    ..
    so when you use or operator you will only switch the booleans on but not off:
    101011010101001 OR
    111010010101011
    _______________
    111011010101011

    hope this helped
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  8. #8
    Addicted Member
    Join Date
    Feb 2000
    Location
    London, UK
    Posts
    145
    I use:

    CommonDialog1.Flags = &H2 & &H4

    But when I set the flag for allowing choosing multipel files I get a common dialog which looks like the one for Win 3.1.
    Does anyone experiance this as well?
    Aslo, I've noticed that I can't use more then two or three flags at the same time.
    Pentax
    Wilhelm Tunemyr,
    Swede in London

    [email protected]

    "Dort, wo man Bücher verbrennt, verbrennt man am Ende auch Menschen"
    Heinrich Heine (1797-1856)

    Pravda vítezi!
    (Truth prevails!)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width