473,387 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How can I develop a drop-down font control ???

Hi,

I am trying to list all font families in a combo box control.
But all font families does not support all font styles .

How can i get the list of all font style and font size supported by a
specific font family
like in font dialog window control ???

Please help me and reply as soon as possible.

ThankYou

Nov 17 '06 #1
2 4690
System.Drawing.Text.InstalledFontCollection x = new
System.Drawing.Text.InstalledFontCollection();
foreach(FontFamily x1 in x.Families)
{
MessageBox.Show(x1.Name);
}

3000 .NET and SQL Server Interview question ebook
http://www.questpond.com/SampleInter...estionBook.zip

Melisa wrote:
Hi,

I am trying to list all font families in a combo box control.
But all font families does not support all font styles .

How can i get the list of all font style and font size supported by a
specific font family
like in font dialog window control ???

Please help me and reply as soon as possible.

ThankYou
Nov 17 '06 #2
Hi Melisa,

(using System.Drawing)

foreach (FontFamily family in FontFamily.Families)
{
Console.WriteLine(family.Name);
Console.WriteLine("\t\tBold={0}",
family.IsStyleAvailable(FontStyle.Bold));
Console.WriteLine("\t\tItalic={0}",
family.IsStyleAvailable(FontStyle.Italic));
Console.WriteLine("\t\tUnderline={0}",
family.IsStyleAvailable(FontStyle.Underline));
}

I'm not sure, but I think the font sizes are hard-coded. For instance, I've
chosen Arial 8 in some applications (IIRC, VS.NET) from the dialog and it's
converted to 7.5 automatically.

--
Dave Sexton

"Melisa" <pr*************@nagarro.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.com...
Hi,

I am trying to list all font families in a combo box control.
But all font families does not support all font styles .

How can i get the list of all font style and font size supported by a
specific font family
like in font dialog window control ???

Please help me and reply as soon as possible.

ThankYou

Nov 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

30
by: Erwin Moller | last post by:
Hi group, Just curious what IDEs are popular nowadays. What do you expect from an IDE? Debugging? Do you use your IDE for debugging, or do you work like me? (Just use some smart-placed...
0
by: Patrick Robinson | last post by:
Hi all, I'm looking to develop a drag and drop gui for an application i'm writing and although pretty familiar with the java language/awt this is the first time i've needed to use this style of...
0
by: João Maia | last post by:
Hello I’m trying to develop a functionality, something like drag and drop objects. I have a windows form and I want to select an area in the forms window that I can drag drop all the select...
2
by: John Jenkins | last post by:
Hi, I need to develop an app that can drag an xml file from my desktop and drop it into a textbox, where it iwll be displayed. 1. I though this should be straightforward but I cannot get it to...
2
by: Mc Spooney | last post by:
I have installed the open source C# IDE, Sharp Develop. Is there a component pallete to allow you to drag and drop controls, such as text boxes and labels etc onto a form ? If so how do you switch...
2
by: Bud | last post by:
Hi I'm new to .net. I would like to develop a web application where I can drag a 'Customer Name" from a tree list and drop it on a "Update Customer Address Button" . Are there any simple VB examples...
1
by: dotnet | last post by:
Hi, I need to develop web application using vs.net I've started with asp.net I've books for asp.net and C#. But any book or sites deal only with note pad. How do I learn how to use vs.net to...
1
by: Cylix | last post by:
My application have a file list, I set the the list will drag the file fullpath string already. When I drop it to outlook email, it pasted as a text ... How can I paste it as a attachment? ...
1
by: Thi | last post by:
Hi, I am trying to develop an application that allows the users to drag a few file(s) from a zip archive to a destination. My question is, how do i determine where the drop destination is...
2
by: Andreas Mueller | last post by:
Hi All, I'm trying to show a context menu during a drag drop operation similar to the windows explorers right click drag and drop behavior (A full working sample is at the end of the post): ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.