[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

08/18/2009 at 03:20AM PDT, ID: 24660871
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.7

how to calculate string width in a web appliaction

Asked by rakeshjaimini in C# Programming Language, Programming for ASP.NET, WebApplications

Tags: C#, stringwidth, asp.net

hi,
i'm facing a nightmare issue in our menus

the menu is inside a div of fixed width of 180px
the menuitem text is creating the problem
right now menuitem text is truncated on the basis of no of character but this is not the solution as 'CCCC' takes more space then 'iiii'

the menuitem css used is
font-family:Arial, helvetica,Geneva, sans-serif;
font-size:.75em;

now I'm changing the logic of truncation of menuitem text by using width of the string but issues are
1.i need to calculate width of the string according to the client machine
2. client's monitor resolution+installed fonts should be taken care of

so as everything is  not possible so I'm trying to make an approximate approach by using MeasureString of graphics object but not getting the required result
i'm trying following code but cant make it complete
1:
2:
3:
4:
5:
6:
7:
Bitmap bmForGraphics = new Bitmap(300, 300);
                    FontFamily fmServicenetMenuFont = new FontFamily("Arial");
                    Font fontServicenetMenuFont = new Font(fmServicenetMenuFont, 0.75f);
                    Graphics graphicsObject = System.Drawing.Graphics.FromImage(bmForGraphics);
                    graphicsObject.PageUnit = GraphicsUnit.Pixel;
                    //graphicsObject.PageScale = 1;
                    SizeF strTextWidth = graphicsObject.MeasureString(strText, fontServicenetMenuFont);
Attachments:
 
Issue
Issue
 
 
Issue
Issue
 
[+][-]08/18/09 03:50 AM, ID: 25121724

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/18/09 03:55 AM, ID: 25121762

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/18/09 05:12 AM, ID: 25122321

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/18/09 05:23 AM, ID: 25122405

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/18/09 06:15 AM, ID: 25122816

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/18/09 06:17 AM, ID: 25122839

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/18/09 06:22 AM, ID: 25122872

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/18/09 07:02 AM, ID: 25123274

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08/18/09 07:08 AM, ID: 25123328

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/18/09 04:04 PM, ID: 25128416

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/18/09 11:11 PM, ID: 25129966

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/19/09 02:04 AM, ID: 25130700

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/19/09 02:44 AM, ID: 25130900

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/19/09 02:53 AM, ID: 25130938

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: C# Programming Language, Programming for ASP.NET, WebApplications
Tags: C#, stringwidth, asp.net
Sign Up Now!
Solution Provided By: abel
Participating Experts: 3
Solution Grade: A
 
 
[+][-]08/19/09 02:59 AM, ID: 25130962

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91 - Hierarchy / EE_QW_EXPERT_20070906