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. .NET (Core and Framework)
  4. MessageBox with custom background color

MessageBox with custom background color

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpquestionc++business
5 Posts 3 Posters 0 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.
  • P Offline
    P Offline
    peterdrozd
    wrote on last edited by
    #1

    I have researched adding a MessageBox to an application. However the sealed class does not give you much. The solution is always to create your own. I figure you could use the Win32 Version and import it into C#. but that does not take care of the background color. in MFC you call setdlgBackColor or something like that and the entire application is converted to the new color (skin). in C# you do not have that. is this exposed in VB.NET? I was thinking I could link in a VB.NET DLL with the functionality. still there are several dialogs in windows that act this way. one of them is the fileopen dialog. does anyone have an elegant solution that does not involve recoding the entire functionality, LOL, of the dialog / MessageBox in question? there are many people on the web running into this problem, especially if they are skinning their apps or providing custom colors for customer requirements. Thanks -Pete

    L P 2 Replies Last reply
    0
    • P peterdrozd

      I have researched adding a MessageBox to an application. However the sealed class does not give you much. The solution is always to create your own. I figure you could use the Win32 Version and import it into C#. but that does not take care of the background color. in MFC you call setdlgBackColor or something like that and the entire application is converted to the new color (skin). in C# you do not have that. is this exposed in VB.NET? I was thinking I could link in a VB.NET DLL with the functionality. still there are several dialogs in windows that act this way. one of them is the fileopen dialog. does anyone have an elegant solution that does not involve recoding the entire functionality, LOL, of the dialog / MessageBox in question? there are many people on the web running into this problem, especially if they are skinning their apps or providing custom colors for customer requirements. Thanks -Pete

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

      This article[^] has some good suggestions.

      P 1 Reply Last reply
      0
      • L Lost User

        This article[^] has some good suggestions.

        P Offline
        P Offline
        peterdrozd
        wrote on last edited by
        #3

        This is a great Article - Thanks! I could not figure out how to change the background color though. I did not see anything in the code of the project that allowed you to do that. -Pete

        L 1 Reply Last reply
        0
        • P peterdrozd

          This is a great Article - Thanks! I could not figure out how to change the background color though. I did not see anything in the code of the project that allowed you to do that. -Pete

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

          peterdrozd wrote:

          I could not figure out how to change the background color though.

          You could try posting your question on the article forum to see if the author has any idea. I suspect you may find it quicker just to use a custom dialog with all your own controls and formats.

          1 Reply Last reply
          0
          • P peterdrozd

            I have researched adding a MessageBox to an application. However the sealed class does not give you much. The solution is always to create your own. I figure you could use the Win32 Version and import it into C#. but that does not take care of the background color. in MFC you call setdlgBackColor or something like that and the entire application is converted to the new color (skin). in C# you do not have that. is this exposed in VB.NET? I was thinking I could link in a VB.NET DLL with the functionality. still there are several dialogs in windows that act this way. one of them is the fileopen dialog. does anyone have an elegant solution that does not involve recoding the entire functionality, LOL, of the dialog / MessageBox in question? there are many people on the web running into this problem, especially if they are skinning their apps or providing custom colors for customer requirements. Thanks -Pete

            P Offline
            P Offline
            Palash Biswas
            wrote on last edited by
            #5

            You must have to write a custom control to do that...

            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