Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Font Properties and how to use them

Reply
Thread Tools

Font Properties and how to use them

 
 
Pete Ehli
Guest
Posts: n/a
 
      05-21-2004
Hello List,
I have a custom web control that during the render phase of the controls
life cycle I am rendering a table with one row and two columns. I have text
inside a column of this table and I want a user of my control to be able to
change the Font properties of this text. Below is the code I'm using to
change the FontInfo subproperties.

System.Web.UI.WebControls.Style st = new Style();

[DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content),
NotifyParentProperty(true)]
//,PersistenceMode(PersistenceMode.InnerProperty)]
public FontInfo Font
{
get
{
return this.st.Font;
}
}

My control inherits from Control since it doesn't render any HTML (but a lot
of DHTML) except this simple table. I'm using the HtmlTextWriter's
writer.writeline method to render the table but how can I use my Font
subproperties to change my table text. The font properties are rendered via
the aspx page that contains my control as hyphen delimited Font-Names="Arial
Black" Font-Size="Medium" etc Is there an easy way to add these properties
to my table text in stead of having to write them like so...
"<Font Face=" + "'" + Font.Name + "'" + ">" + My Table Text + "</Font>"

Thanks in advance


 
Reply With Quote
 
 
 
 
Vidar Petursson
Guest
Posts: n/a
 
      05-21-2004
Hi

Why not css

<table style="font-family:arial,verdana,font-size:" + daSize.....

More info
http://msdn.microsoft.com/library/de...ence_entry.asp

--
Best Regards
Vidar Petursson
==============================
Microsoft Scripting MVP
http://www.microsoft.com/technet/scriptcenter
==============================
"Pete Ehli" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello List,
> I have a custom web control that during the render phase of the controls
> life cycle I am rendering a table with one row and two columns. I have
> text
> inside a column of this table and I want a user of my control to be able
> to
> change the Font properties of this text. Below is the code I'm using to
> change the FontInfo subproperties.
>
> System.Web.UI.WebControls.Style st = new Style();
>
> [DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content),
> NotifyParentProperty(true)]
> //,PersistenceMode(PersistenceMode.InnerProperty)]
> public FontInfo Font
> {
> get
> {
> return this.st.Font;
> }
> }
>
> My control inherits from Control since it doesn't render any HTML (but a
> lot
> of DHTML) except this simple table. I'm using the HtmlTextWriter's
> writer.writeline method to render the table but how can I use my Font
> subproperties to change my table text. The font properties are rendered
> via
> the aspx page that contains my control as hyphen delimited
> Font-Names="Arial
> Black" Font-Size="Medium" etc Is there an easy way to add these properties
> to my table text in stead of having to write them like so...
> "<Font Face=" + "'" + Font.Name + "'" + ">" + My Table Text + "</Font>"
>
> Thanks in advance
>
>



 
Reply With Quote
 
 
 
 
Peter Ehli
Guest
Posts: n/a
 
      05-22-2004
I'm not following what this has to do with a Web Control Library. As a
control author I want to make it as easy as possible for a developer to add
my control to the (toolbox i..e dll) drag and drop it onto a form and then
change some properties and run the page that contains the control. To change
the Font Face and Size of an ASP.NET command button you don't need a style
sheet. Sure you can use a CSS if you have multiple command buttons which is
a practice I'm familiar with. I want my control to act like a command button
for instance when a user of my control changes the font properties. Thanks.



"Vidar Petursson" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> Hi
>
> Why not css
>
> <table style="font-family:arial,verdana,font-size:" + daSize.....
>
> More info
>

http://msdn.microsoft.com/library/de...ence_entry.asp
>
> --
> Best Regards
> Vidar Petursson
> ==============================
> Microsoft Scripting MVP
> http://www.microsoft.com/technet/scriptcenter
> ==============================
> "Pete Ehli" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hello List,
> > I have a custom web control that during the render phase of the controls
> > life cycle I am rendering a table with one row and two columns. I have
> > text
> > inside a column of this table and I want a user of my control to be

able
> > to
> > change the Font properties of this text. Below is the code I'm using to
> > change the FontInfo subproperties.
> >
> > System.Web.UI.WebControls.Style st = new Style();
> >
> >

[DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content),
> > NotifyParentProperty(true)]
> > //,PersistenceMode(PersistenceMode.InnerProperty)]
> > public FontInfo Font
> > {
> > get
> > {
> > return this.st.Font;
> > }
> > }
> >
> > My control inherits from Control since it doesn't render any HTML (but a
> > lot
> > of DHTML) except this simple table. I'm using the HtmlTextWriter's
> > writer.writeline method to render the table but how can I use my Font
> > subproperties to change my table text. The font properties are rendered
> > via
> > the aspx page that contains my control as hyphen delimited
> > Font-Names="Arial
> > Black" Font-Size="Medium" etc Is there an easy way to add these

properties
> > to my table text in stead of having to write them like so...
> > "<Font Face=" + "'" + Font.Name + "'" + ">" + My Table Text + "</Font>"
> >
> > Thanks in advance
> >
> >

>
>



 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Swing Font, it's Java Font? ot native? how install new font? mttc Java 2 07-03-2009 07:29 PM
HttpHandlers - Learn Them. Use Them. Anonieko ASP .Net 5 06-16-2006 06:19 PM
ClearType: Does Java AWT use its own font or use the OS's font in displaying text field? gino Java 3 07-11-2004 01:57 AM
JavaRE 1.4.2 font alias in /lib/font.properties (Linux) Nick Spinel Java 0 07-25-2003 08:28 AM



Advertisments