|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Trimming Windows form caption bar textHi,
In the resize event handler of my Windows form, I want to replace a portion of the form's title with ellipsis when the form is too small to completely fit the title. What's the easiest way to generate a trimmed, best-fit caption title? I'm using .NET Framework 2.0. Thx. When you control the painting of text, there are overloads of the
Graphics.DrawString method that allow you to specify the overflow handling method. However, you don't control the painting of the text in the title bar of the form. So, your best bet is to use Graphics.MeasureString to measure the size of the title, and truncate it to fit. -- Show quoteHTH, Kevin Spencer Chicken Salad Surgeon Microsoft MVP "PacManFan" <PacMan***@discussions.microsoft.com> wrote in message news:44593413-9C00-4ADF-BB59-3C959237AB5C@microsoft.com... > Hi, > > In the resize event handler of my Windows form, I want to replace a > portion > of the form's title with ellipsis when the form is too small to completely > fit the title. What's the easiest way to generate a trimmed, best-fit > caption > title? I'm using .NET Framework 2.0. > > Thx. > > |
|||||||||||||||||||||||