CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 4/26/2005 6:19:59 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 47 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
KenRay
Asp.Net User
Setting a Default Value on a Control Property4/26/2005 6:19:59 PM

-1/1

I have a composite control, of which one property is the text color for error messages.  I want to set the default value to maroon, but allow it to be overridden at design time.  This is what I have started with:

 <Category("Behaviour"), Description("Color of error message
text"), DefaultValue("Maroon"),
TypeConverter(GetType(System.Drawing.Color))> _
    Public Property ErrorTextColor() As System.Drawing.Color

but I must be doing something wrong.  In VS.Net design view, Maroon shows up as the color, but bolded as if it wasn't really the default value.  And when I click on "reset" for that property, I get the "Object type cannot be converted to target type" error.  I probably have screwed up the TypeConverter statement, or something like that.

Any clues?

DMW
Asp.Net User
Re: Setting a Default Value on a Control Property4/27/2005 2:20:16 AM

0/0

Your type converter should be a System.Drawing.ColorConverter. The attribute refers to the class that will perform the conversion and not what you wanted it converted to.

Doubtless you're aware of this, but I found it quite a shock when the DefaultValue attribute didn't get used by the designer to set the default value. Far from it. It is used by the designer solely to make a decision when it should, or shouldn't bother to store the value. Therefore, I hope that you have the field (or whatever is supposed to be Maroon) set to Maroon in your code.
Dave
KenRay
Asp.Net User
Re: Setting a Default Value on a Control Property4/27/2005 12:38:20 PM

0/0

Thanks for the help.  I wasn't aware of the limitation on the "DefaultValue" attribute, in that is is really "cosmetic" only.  Now to set the default value on the private variables corresponding to each property.

But I still seem to be getting the default value object type problems.

Here is what I have in the attributes section:

    <Category("Behaviour"), Description("Color of error message text"), DefaultValue("System.Drawing.Color.Maroon"), TypeConverter(GetType(System.Drawing.ColorConverter))> _
    Public Property ErrorTextColor() As System.Drawing.Color


Once I bring up properties, it is set to maroon - but it doesn't appear as the default, and reset gives the same error message.
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning InfoPath 2003 Authors: F. Scott Barker, Pages: 384, Published: 2005
Access 2003 Personal Trainer Authors: CustomGuide Inc, Michele Filshie, CustomGuide Inc, Pages: 348, Published: 2005
Microsoft Office Access 2003: The Complete Reference Authors: Virginia Andersen, Pages: 719, Published: 2003
How to Do Everything with Microsoft Office Access 2007 Authors: Virginia Andersen, Pages: 1024, Published: 2006
Access 2002 VBA Handbook Authors: Susann Novalis, Dana Jones, Pages: 880, Published: 2001
Professional VB.NET Authors: Fred Barwell, Richard Case, Bill Forgey, Billy Hollis, Jonathan Pinnock, Richard Blair, Tim McCarthy, Whitney Hankison, Jonathan Crossland, Jan Narkiewicz, Rockford Lhotka, Rama Ramachandran, Matthew Reynolds, John Roth, Bill Sheldon, Bill Sempf, Pages: 1032, Published: 2002
Mastering Microsoft VBA Authors: Guy Hart-Davis, Pages: 707, Published: 2005
Windows Forms Programming in C# Authors: Chris Sells, Pages: 681, Published: 2004
Special Edition Using Visual Basic.Net Authors: Brian Siler, Jeff Spotts, Pages: 830, Published: 2002
Using Microsoft Office XP Authors: Ed Bott, Woody Leonhard, Pages: 1158, Published: 2001

Web:
CodeProject: How to set DefaultValue for Font Property?. Free ... Feb 12, 2006 ... But if you want to set default value for Font property with this ... A class that allows you to display your data for a control as tooltip ...
How to set the DefaultValue for a Color property in a control - bytes Use a "ShouldSerializeX" method. http://msdn.microsoft.com/library/de... setmethods.asp -- Tim Wilson ..Net Compact Framework MVP "bbrik&.
Control.DefaultValue isn't. - Miscellaneous Debris Nov 6, 2005 ... One of the designer attributes you can put on a control's properties is the System.ComponentModel.DefaultValue attribute, that defines the ...
Dr. Dobb's | Adding .NET Control Properties | March 1, 2004 Until you define a default value for the property, it is always shown in bold. ... control has a large number of properties, where setting a new mode value ...
DefaultValue Property - Access - Microsoft Office Online control to =Now() , the control displays the current date and time. The maximum length for a DefaultValue property setting is 255 characters. ...
languages csharp How to set the DefaultValue for a Color property ... Hi, I'm doing a control that has a custom color property and i want to set a default value. I tried several combinations using the DefaultValue atribute but ...
Default value from property for edit control [Archive] - Acresso ... But I should be able to use a property in the default value ... Anyway, as for the edit control, setting its property value to ...
Calendar Control 10...setting a default value : calendar, control ... Mar 25, 2005 ... Calendar Control 10...setting a default value .... he problem with setting the value is that once it was written into the Value property, ...
Safari Books Online - 0596009372 - Access 2003: Personal Trainer Working with Forms > Changing a Control's Default Value ... personaltrainer 7-23 . Setting the Default Value property for a control . ...
Francesco Balena’s Blog Setting the default value for enumerated ... Nov 17, 2007 ... Setting the default value for enumerated properties in VB. ... of a Windows Forms control, you typically need to define its default value. ...

Videos:
Duluth Chamber of Commerce luncheon with Minnesota State Auditor Minnesota State Auditor Patricia Anderson's Remarks to Duluth Chamber of Commerce - June 19, 2006
Zero Configuration networking with Bonjour Google TechTalks November 2, 2005 Dr. Stuart Cheshire, Apple Computer http://www.stuartcheshire.org/ ABSTRACT The desirability of making ...
Distributed continuous quality assurance Google London Test Automation Conference (LTAC) Google Tech Talks September 8th, 2006 Presenter: Adam Porter
Upcoming Changes to the JavaScript Language Google Tech Talks November, 14 2007 ABSTRACT After eight years of work in the standards committee, JavaScript will soon get an update. We ...
p6apclps #39 Perl 6 Apocalypse http://www.perlfoundation.org/perl6 - - that marks the exception as "cleanly caught". It should be considered an invariant that any $! in the ...
Zeitgeist, The Movie | Final Edition [ ENGLISH subtitles ] Zeitgeist, The Movie | Final Edition [ ENGLISH subtitles ]
Zeitgeist 2 : Addendum - Subtitles English / French Zeitgeist: Addendum, by Peter Joseph 2008 English Subtitles ! French See ya later on thezeitgeistmovement.com You can Download Srt file ...
Zeitgeist Addendum Zeitgeist: Addendum, attempts to locate the root causes of this pervasive social corruption, while offering a solution. This solution is not based ...
p6apclps #81 Perl 6 Apocalypse http://www.perlfoundation.org/perl6 - - should be on by default 160 acc Function-call named parameters (with compiler optimizations) 168 abb ...
Computers versus Common Sense Google TechTalks May 30, 2006 Douglas Lenat Dr. Douglas Lenat is the President and CEO of Cycorp. Since 1984, he and his team have been ...




Search This Site:










object reference not set to an instance of an object error on an unbound dropdownlist

how to start

payment through authorized.net

web.config updating programatically

opening page http://localhost/aspnet_client/system_web/1_1_4322/smartnav.htm

creating a gallery

lost need help hosting issue

how to use findcontrol in a external class?

i have a web site where i input stories and set the publish date to some time in future and set an hour from 1-24....

how can i create a search engine that searches files and folders in my website?

ibs for flash? and charts

color problem ? panel1.backcolor = drawing.color.crimson.. how can i write #cc0000 of color as code line ?

partial classes

how to retrieve the value from a querystring variable?

how to use smtp send mail with asp.net

redirecting from https to http

linux

search page in asp .net 2.0

can you databind a sqldatasource from another page?

regular expression string for password

i can't install the ibuyspy storevb sdk onto server 2003 with iis6.0 sql, server2k with latest update, and framework 1.1.

help desgining something [one xml file for all users]

how to add controls to a control collection?

how to trigger sending of reminder emails automatically

left trim

using two dropdown menus...first drop down figures out what dropdown 2 will be

reload to top of the page

app_code directory quetsion.

multithread access to httpcontext.current from global.asax

simulating a windows service

  Privacy | Contact Us
All Times Are GMT