Click here to Skip to main content
15,922,584 members
Home / Discussions / C#
   

C#

 
AnswerRe: hwj Pin
Anthony Mushrow18-May-08 5:50
professionalAnthony Mushrow18-May-08 5:50 
AnswerRe: hwj Pin
Hamid_RT18-May-08 18:29
Hamid_RT18-May-08 18:29 
QuestionHow to get childs window handle ? Pin
hdv21217-May-08 23:29
hdv21217-May-08 23:29 
AnswerRe: How to get childs window handle ? Pin
Giorgi Dalakishvili18-May-08 0:00
mentorGiorgi Dalakishvili18-May-08 0:00 
QuestionPersonal Folder Problem in C# Pin
mohant$.net17-May-08 20:04
mohant$.net17-May-08 20:04 
QuestionGetting path of executing assembly Pin
danielk_17-May-08 19:06
danielk_17-May-08 19:06 
AnswerRe: Getting path of executing assembly Pin
mav.northwind17-May-08 21:58
mav.northwind17-May-08 21:58 
GeneralRe: Getting path of executing assembly Pin
Brady Kelly18-May-08 1:55
Brady Kelly18-May-08 1:55 
AnswerRe: Getting path of executing assembly Pin
#realJSOP18-May-08 1:49
professional#realJSOP18-May-08 1:49 
AnswerRe: Getting path of executing assembly Pin
Brady Kelly18-May-08 2:20
Brady Kelly18-May-08 2:20 
GeneralRe: Getting path of executing assembly Pin
danielk_18-May-08 3:26
danielk_18-May-08 3:26 
QuestionC# SendMessage in C++ Pin
luisgrimaldo17-May-08 17:57
luisgrimaldo17-May-08 17:57 
AnswerRe: C# SendMessage in C++ Pin
Christian Graus17-May-08 18:09
protectorChristian Graus17-May-08 18:09 
GeneralRe: C# SendMessage in C++ Pin
luisgrimaldo17-May-08 18:19
luisgrimaldo17-May-08 18:19 
GeneralRe: C# SendMessage in C++ Pin
Christian Graus17-May-08 18:35
protectorChristian Graus17-May-08 18:35 
Questionfile download c# asp.net Pin
irusul17-May-08 13:09
irusul17-May-08 13:09 
AnswerRe: file download c# asp.net Pin
Christian Graus17-May-08 13:25
protectorChristian Graus17-May-08 13:25 
Questionset cursor position on control in active form Pin
baranils17-May-08 11:00
baranils17-May-08 11:00 
AnswerRe: set cursor position on control in active form Pin
William Ten Broek17-May-08 11:38
William Ten Broek17-May-08 11:38 
GeneralRe: set cursor position on control in active form Pin
baranils17-May-08 12:06
baranils17-May-08 12:06 
QuestionProgrmming with USB in C# (Need a book) Pin
hdv21217-May-08 10:50
hdv21217-May-08 10:50 
AnswerRe: Progrmming with USB in C# (Need a book) Pin
Christian Graus17-May-08 12:52
protectorChristian Graus17-May-08 12:52 
AnswerRe: Progrmming with USB in C# (Need a book) Pin
Giorgi Dalakishvili17-May-08 22:36
mentorGiorgi Dalakishvili17-May-08 22:36 
QuestionReportViewer Speed Pin
Amir Jalaly17-May-08 9:24
Amir Jalaly17-May-08 9:24 
QuestionTextRenderer.DrawText with TextFormatFlags.ModifyString Pin
Lea Hayes17-May-08 8:09
Lea Hayes17-May-08 8:09 
Hi all!

I am creating a simple user control which renders text within its paint event handler. Under some circumstances (when the output rectangle is very small) the exception "The object is already in use elsewhere." occurs...Which does not make any sense because a) the program is not multithreaded and b) it isn't particuarly complex. This crashing began when I started using the TextFormatFlags.ModifyString flag, and the problem is likewise immediately cured by removing this flag.

Am I using the flag in an incorrect fashion? The itemLabel string is actually updated correctly (end ellipsis is added when displayed).

// Force duplication of string, the original value is changed otherwise.
string itemLabel = new string(item.Label.ToCharArray());

// Use text renderer to output required text.
TextRenderer.DrawText(ctx.Graphics, itemLabel, activeFont, Rectangle.Round(extraLabelBounds), textColour, backgroundColor, TextFormatFlags.EndEllipsis | TextFormatFlags.ModifyString);


If this is a problem, is it possible to get the EndEllipsis version of the string based upon the graphics context, font, output rectangle bounds, and text?

Many thanks!
Lea Hayes

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.