Color Dialog

Discussion in 'ASP .Net' started by WhoopDing, Feb 20, 2005.

  1. WhoopDing

    WhoopDing Guest

    How do I display a Color Dialog in the client browser?

    I want the Color Dialog to be displayed when the user clicks a button.
     
    WhoopDing, Feb 20, 2005
    #1
    1. Advertising

  2. WhoopDing

    Scott Allen Guest

    Scott Allen, Feb 20, 2005
    #2
    1. Advertising

  3. WhoopDing

    WhoopDing Guest

    Sorry, maybe I should be a bit more specific.

    I am new to .Net. So, my query is no doubt a simple one.

    I have the folowing code in the WebForm:
    Imports System.Windows.Forms.ColorDialog

    ....

    Private ColorDialog As New Windows.Forms.ColorDialog

    The problem I get is I get an error when the button that opens then
    ColorDialog is clicked.

    This is the error:

    It is invalid to show a modal dialog or form when the application is not
    running in UserInteractive mode. Specify the ServiceNotification or
    DefaultDesktopOnly style to display a notification from a service
    application.

    The code in the Button Click EventHnadler is:

    Private Sub cmdColor_Click(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles cmdColor.Click

    ColorDialog.ShowDialog()

    If ColorDialog.ShowDialog = Windows.Forms.DialogResult.OK Then

    pnlColor.BackColor = ColorDialog.Color

    End If

    End Sub

    "Scott Allen" <> wrote in message
    news:...
    > There is a color dialog control in Win32, but if you want a 100% web
    > based solution you'll need to roll your own, or build on top of
    > existing work:
    > http://www.google.com/search?hl=en&lr=&c2coff=1&q=asp.net client side color picker
    >
    > --
    > Scott
    > http://www.OdeToCode.com/blogs/scott/
    >
    > On Sun, 20 Feb 2005 01:11:27 -0000, "WhoopDing"
    > <> wrote:
    >
    >>How do I display a Color Dialog in the client browser?
    >>
    >>I want the Color Dialog to be displayed when the user clicks a button.
    >>

    >
     
    WhoopDing, Feb 20, 2005
    #3
  4. WhoopDing

    Scott Allen Guest

    Yes, WhoopDing - this is what I was trying to point out.

    In ASP.NET development you can't use classes from System.Windows.Forms
    to pop up dialogs and such on a user's screen.

    The client's web browser makes a request to your application, and your
    application should respond with HTML and JavaScript that the browser
    can interpret and display. The code you are working with executes on
    the server - you don't want to pop up a dialog on the web server.

    Hope this is making some sense,

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/


    On Sun, 20 Feb 2005 12:29:42 -0000, "WhoopDing"
    <> wrote:

    >Sorry, maybe I should be a bit more specific.
    >
    >I am new to .Net. So, my query is no doubt a simple one.
    >
    >I have the folowing code in the WebForm:
    >Imports System.Windows.Forms.ColorDialog
    >
    >...
    >
    >Private ColorDialog As New Windows.Forms.ColorDialog
    >
    >The problem I get is I get an error when the button that opens then
    >ColorDialog is clicked.
    >
    >This is the error:
    >
    >It is invalid to show a modal dialog or form when the application is not
    >running in UserInteractive mode. Specify the ServiceNotification or
    >DefaultDesktopOnly style to display a notification from a service
    >application.
    >
    >The code in the Button Click EventHnadler is:
    >
    >Private Sub cmdColor_Click(ByVal sender As Object, ByVal e As
    >System.EventArgs) Handles cmdColor.Click
    >
    >ColorDialog.ShowDialog()
    >
    >If ColorDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
    >
    >pnlColor.BackColor = ColorDialog.Color
    >
    >End If
    >
    >End Sub
    >
    >"Scott Allen" <> wrote in message
    >news:...
    >> There is a color dialog control in Win32, but if you want a 100% web
    >> based solution you'll need to roll your own, or build on top of
    >> existing work:
    >> http://www.google.com/search?hl=en&lr=&c2coff=1&q=asp.net client side color picker
    >>
    >> --
    >> Scott
    >> http://www.OdeToCode.com/blogs/scott/
    >>
    >> On Sun, 20 Feb 2005 01:11:27 -0000, "WhoopDing"
    >> <> wrote:
    >>
    >>>How do I display a Color Dialog in the client browser?
    >>>
    >>>I want the Color Dialog to be displayed when the user clicks a button.
    >>>

    >>

    >
     
    Scott Allen, Feb 20, 2005
    #4
  5. WhoopDing

    WhoopDing Guest

    OK, I have that. How, then, do I cause the browser to open a dialog box
    where the user can select a color?

    Forgive my newness!

    Thanks

    "Scott Allen" <> wrote in message
    news:...
    > Yes, WhoopDing - this is what I was trying to point out.
    >
    > In ASP.NET development you can't use classes from System.Windows.Forms
    > to pop up dialogs and such on a user's screen.
    >
    > The client's web browser makes a request to your application, and your
    > application should respond with HTML and JavaScript that the browser
    > can interpret and display. The code you are working with executes on
    > the server - you don't want to pop up a dialog on the web server.
    >
    > Hope this is making some sense,
    >
    > --
    > Scott
    > http://www.OdeToCode.com/blogs/scott/
    >
    >
    > On Sun, 20 Feb 2005 12:29:42 -0000, "WhoopDing"
    > <> wrote:
    >
    >>Sorry, maybe I should be a bit more specific.
    >>
    >>I am new to .Net. So, my query is no doubt a simple one.
    >>
    >>I have the folowing code in the WebForm:
    >>Imports System.Windows.Forms.ColorDialog
    >>
    >>...
    >>
    >>Private ColorDialog As New Windows.Forms.ColorDialog
    >>
    >>The problem I get is I get an error when the button that opens then
    >>ColorDialog is clicked.
    >>
    >>This is the error:
    >>
    >>It is invalid to show a modal dialog or form when the application is not
    >>running in UserInteractive mode. Specify the ServiceNotification or
    >>DefaultDesktopOnly style to display a notification from a service
    >>application.
    >>
    >>The code in the Button Click EventHnadler is:
    >>
    >>Private Sub cmdColor_Click(ByVal sender As Object, ByVal e As
    >>System.EventArgs) Handles cmdColor.Click
    >>
    >>ColorDialog.ShowDialog()
    >>
    >>If ColorDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
    >>
    >>pnlColor.BackColor = ColorDialog.Color
    >>
    >>End If
    >>
    >>End Sub
    >>
    >>"Scott Allen" <> wrote in message
    >>news:...
    >>> There is a color dialog control in Win32, but if you want a 100% web
    >>> based solution you'll need to roll your own, or build on top of
    >>> existing work:
    >>> http://www.google.com/search?hl=en&lr=&c2coff=1&q=asp.net client side color picker
    >>>
    >>> --
    >>> Scott
    >>> http://www.OdeToCode.com/blogs/scott/
    >>>
    >>> On Sun, 20 Feb 2005 01:11:27 -0000, "WhoopDing"
    >>> <> wrote:
    >>>
    >>>>How do I display a Color Dialog in the client browser?
    >>>>
    >>>>I want the Color Dialog to be displayed when the user clicks a button.
    >>>>
    >>>

    >>

    >
     
    WhoopDing, Feb 20, 2005
    #5
  6. WhoopDing

    WhoopDing Guest

    That's what I want.

    Thanks for your help (sorry to be a pest).

    "Scott Allen" <> wrote in message
    news:...
    > What I would do is look at some of the color picker controls people
    > have built, there are a few on this page:
    >
    > http://asp.net/ControlGallery/default.aspx?Category=7&tabindex=2
    >
    > Depending on how you want the user to interact with the control and
    > how many colors it displays, etc, etc you might chose to use one or
    > take the source code from an existing control and tweak it.
    >
    >
    > --
    > Scott
    > http://www.OdeToCode.com/blogs/scott/
    >
    > On Sun, 20 Feb 2005 15:16:38 -0000, "WhoopDing"
    > <> wrote:
    >
    >>OK, I have that. How, then, do I cause the browser to open a dialog box
    >>where the user can select a color?
    >>
    >>Forgive my newness!
    >>

    >
     
    WhoopDing, Feb 20, 2005
    #6
  7. WhoopDing

    Scott Allen Guest

    What I would do is look at some of the color picker controls people
    have built, there are a few on this page:

    http://asp.net/ControlGallery/default.aspx?Category=7&tabindex=2

    Depending on how you want the user to interact with the control and
    how many colors it displays, etc, etc you might chose to use one or
    take the source code from an existing control and tweak it.


    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    On Sun, 20 Feb 2005 15:16:38 -0000, "WhoopDing"
    <> wrote:

    >OK, I have that. How, then, do I cause the browser to open a dialog box
    >where the user can select a color?
    >
    >Forgive my newness!
    >
     
    Scott Allen, Feb 20, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Smithers

    Color Picker Dialog Recommendations

    Smithers, Feb 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    379
    Smithers
    Feb 23, 2005
  2. Tina

    Font & color dialog boxes??

    Tina, Mar 10, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    401
  3. yw
    Replies:
    3
    Views:
    843
    Phlip
    Jul 2, 2005
  4. Kamaljeet Saini
    Replies:
    0
    Views:
    494
    Kamaljeet Saini
    Feb 13, 2009
  5. Matt
    Replies:
    1
    Views:
    305
    Randy Webb
    Nov 20, 2004
Loading...

Share This Page