Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Style Common Dialog Boxes

Style Common Dialog Boxes

Scheduled Pinned Locked Moved WPF
question
4 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RNEELY
    wrote on last edited by
    #1

    How can one apply an application style to the Common Dialogs? I've got a dark style going on in my app and this file open dialog is so bright it is jarring. Any ideas? // Configure open file dialog box Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); dlg.FileName = "Document"; // Default file name dlg.DefaultExt = ".txt"; // Default file extension dlg.Filter = "Text documents (.txt)|*.txt"; // Filter files by extension // Show open file dialog box Nullable<bool> result = dlg.ShowDialog(); // Process open file dialog box results if (result == true) { // Open document string filename = dlg.FileName; }

    Sincerely, -Ron

    L 1 Reply Last reply
    0
    • R RNEELY

      How can one apply an application style to the Common Dialogs? I've got a dark style going on in my app and this file open dialog is so bright it is jarring. Any ideas? // Configure open file dialog box Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); dlg.FileName = "Document"; // Default file name dlg.DefaultExt = ".txt"; // Default file extension dlg.Filter = "Text documents (.txt)|*.txt"; // Filter files by extension // Show open file dialog box Nullable<bool> result = dlg.ShowDialog(); // Process open file dialog box results if (result == true) { // Open document string filename = dlg.FileName; }

      Sincerely, -Ron

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Ron, Dialog boxes are generally styled according to the operating system, as opposed to the UI that opened them since the users desktop theme will be used to style the dialog box. Example, Windows XP and Vista File Open dialogs look and work slightly different and are styled according to the users desktop theme. If you check out the WPF SDK, there is a Vista Bridge library that gets you going with using dialog boxes that are operating system specific. I have been hoping that Microsoft would bake operating system dialogs into .NET so that no matter which O/S was running the correct dialog for that O/S would display without a lot of extra work on the developers part. You "could" always write your own... No fun working with the Win32 API if you don't really have to. Sorry I could be of more help.

      Cheers, Karl » CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP Profile

      Just a grain of sand on the worlds beaches.

      R 1 Reply Last reply
      0
      • L Lost User

        Ron, Dialog boxes are generally styled according to the operating system, as opposed to the UI that opened them since the users desktop theme will be used to style the dialog box. Example, Windows XP and Vista File Open dialogs look and work slightly different and are styled according to the users desktop theme. If you check out the WPF SDK, there is a Vista Bridge library that gets you going with using dialog boxes that are operating system specific. I have been hoping that Microsoft would bake operating system dialogs into .NET so that no matter which O/S was running the correct dialog for that O/S would display without a lot of extra work on the developers part. You "could" always write your own... No fun working with the Win32 API if you don't really have to. Sorry I could be of more help.

        Cheers, Karl » CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP Profile

        Just a grain of sand on the worlds beaches.

        R Offline
        R Offline
        RNEELY
        wrote on last edited by
        #3

        Even for a message box?

        Sincerely, -Ron

        L 1 Reply Last reply
        0
        • R RNEELY

          Even for a message box?

          Sincerely, -Ron

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Ron, Yes. Give this article a look: http://www.codeproject.com/KB/WPF/WPFTaskDialogVistaAndXP.aspx[^] This is where you need to make a decision. You can have all custom dialogs or use the operating system ones. For the message boxes, I wanted my XP users to have the rich features of the TaskDialog so I wrote the above library to provide that. I also have similar boxes for my file dialogs.

          Cheers, Karl » CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP Profile

          Just a grain of sand on the worlds beaches.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups