Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Color Dialog

Reply
Thread Tools

Color Dialog

 
 
WhoopDing
Guest
Posts: n/a
 
      02-20-2005
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.


 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      02-20-2005
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&l...e+color+picker

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

On Sun, 20 Feb 2005 01:11:27 -0000, "WhoopDing"
<(E-Mail Removed)> 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.
>


 
Reply With Quote
 
 
 
 
WhoopDing
Guest
Posts: n/a
 
      02-20-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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&l...e+color+picker
>
> --
> Scott
> http://www.OdeToCode.com/blogs/scott/
>
> On Sun, 20 Feb 2005 01:11:27 -0000, "WhoopDing"
> <(E-Mail Removed)> 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.
>>

>



 
Reply With Quote
 
Scott Allen
Guest
Posts: n/a
 
      02-20-2005
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"
<(E-Mail Removed)> 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" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed).. .
>> 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&l...e+color+picker
>>
>> --
>> Scott
>> http://www.OdeToCode.com/blogs/scott/
>>
>> On Sun, 20 Feb 2005 01:11:27 -0000, "WhoopDing"
>> <(E-Mail Removed)> 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.
>>>

>>

>


 
Reply With Quote
 
WhoopDing
Guest
Posts: n/a
 
      02-20-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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"
> <(E-Mail Removed)> 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" <(E-Mail Removed)> wrote in message
>>news:(E-Mail Removed). ..
>>> 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&l...e+color+picker
>>>
>>> --
>>> Scott
>>> http://www.OdeToCode.com/blogs/scott/
>>>
>>> On Sun, 20 Feb 2005 01:11:27 -0000, "WhoopDing"
>>> <(E-Mail Removed)> 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.
>>>>
>>>

>>

>



 
Reply With Quote
 
WhoopDing
Guest
Posts: n/a
 
      02-20-2005
That's what I want.

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

"Scott Allen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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/defaul...y=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"
> <(E-Mail Removed)> 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!
>>

>



 
Reply With Quote
 
Scott Allen
Guest
Posts: n/a
 
      02-20-2005
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/defaul...y=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"
<(E-Mail Removed)> 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!
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing font color from current font color to black color Kamaljeet Saini Ruby 0 02-13-2009 04:58 PM
Font & color dialog boxes?? Tina ASP .Net 0 03-10-2006 12:11 AM
How to hide the dialog when execute a dialog based application in VC? yw C++ 3 07-02-2005 03:35 AM
Color Picker Dialog Recommendations Smithers ASP .Net 0 02-23-2005 02:20 AM
display print preview dialog, not print dialog Matt Javascript 1 11-20-2004 01:18 AM



Advertisments