I have a problem where, depending on the text of a button, the display of
that text seems to change size or alignment.
Here is the code:
HomeScoreNameBu tton.ForeColor = Color.Green;
HomeScoreNameBu tton.Font = new System.Drawing. Font("Tahoma",
8.50F, System.Drawing. FontStyle.Regul ar,
System.Drawing. GraphicsUnit.Po int, ((System.Byte)( 0));
this.HomeScoreN ameButton.Locat ion = new System.Drawing. Location(10,10) ;
this.HomeScoreN ameButton.Name = "HomeScoreNameB utton";
this.HomeScoreN ameButton.Size = new System.Drawing. Size(24,16);
this.HomeScoreN ameButton.Text = "Sunset";
this.HomeScoreN ameButton.TextA lign = System.Drawing. ContentAlignmen t.MiddleRight;
the buttons are small (24,16) for a reason, and I can't make them bigger.
when the text of the button (which changes), is too long to display, it is
simply truncated from the right.
If the button text is "Sunset Girls", then it displays as "Sunset G"
(truncated to fit), and displays properly.
However, if the text is "Sunset Boys", then it displays as "Sunset"
(truncated), which is fine, but now the "S" (capital S) loses the topmost
line of the font, as if the vertical alignment of the button text has
changed, or the size of the font has changed.
Any ideas about what is happening?
Terry Brown www.stickmansoftware.com 7 15971
I believe this has nothing to do whith C#, nor .NET WinForms. I would say
this is a Windows problem.
"Terry Brown" <tt****@gmail.c om> wrote in message
news:pa******** *************** ***@gmail.com.. . I have a problem where, depending on the text of a button, the display of that text seems to change size or alignment.
Here is the code:
HomeScoreNameBu tton.ForeColor = Color.Green; HomeScoreNameBu tton.Font = new System.Drawing. Font("Tahoma", 8.50F, System.Drawing. FontStyle.Regul ar, System.Drawing. GraphicsUnit.Po int, ((System.Byte)( 0)); this.HomeScoreN ameButton.Locat ion = new System.Drawing. Location(10,10) ; this.HomeScoreN ameButton.Name = "HomeScoreNameB utton"; this.HomeScoreN ameButton.Size = new System.Drawing. Size(24,16); this.HomeScoreN ameButton.Text = "Sunset"; this.HomeScoreN ameButton.TextA lign = System.Drawing. ContentAlignmen t.MiddleRight;
the buttons are small (24,16) for a reason, and I can't make them bigger. when the text of the button (which changes), is too long to display, it is simply truncated from the right.
If the button text is "Sunset Girls", then it displays as "Sunset G" (truncated to fit), and displays properly.
However, if the text is "Sunset Boys", then it displays as "Sunset" (truncated), which is fine, but now the "S" (capital S) loses the topmost line of the font, as if the vertical alignment of the button text has changed, or the size of the font has changed.
Any ideas about what is happening?
Terry Brown www.stickmansoftware.com
"Terry Brown" <tt****@gmail.c om> wrote in message
news:pa******** *************** ***@gmail.com.. . I have a problem where, depending on the text of a button, the display of that text seems to change size or alignment.
Try setting the buttons' FlatStyle to System.
-- Alan
On Fri, 13 Jan 2006 12:03:29 -0600, Alan Pretre wrote:
Thanks! That fixes the problem.
I hesitate to ask why . . . "Terry Brown" <tt****@gmail.c om> wrote in message news:pa******** *************** ***@gmail.com.. .I have a problem where, depending on the text of a button, the display of that text seems to change size or alignment.
Try setting the buttons' FlatStyle to System.
-- Alan
"Terry Brown" <tt****@gmail.c om> wrote in message
news:pa******** *************** *****@gmail.com ... I hesitate to ask why . . .
Not sure of the reason, didn't see this problem in .NET 1.1, seems to have
arisen in .NET 2.0.
-- Alan
Are you sure that it's not attempting to wrap the next word onto the
"next line" on the button, of which there is none, and shoving the
"first line" up farther to compensate?
"Bruce Wood" <br*******@cana da.com> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.com.. . Are you sure that it's not attempting to wrap the next word onto the "next line" on the button, of which there is none, and shoving the "first line" up farther to compensate?
Yes it is doing that, but it does it differently depending on that
FlatStyle. All I am saying is that the behavior has changed, I did not see
that behavior in my apps when it was built for .NET 1.1.
-- Alan
On Fri, 13 Jan 2006 15:27:24 -0600, Alan Pretre wrote:
This makes sense to me. Thanks for the discussion. If this is true
(two lines generated) then I can fix the problem my manually truncating
the string to size. I'll give it a shot.
Terry "Bruce Wood" <br*******@cana da.com> wrote in message news:11******** **************@ g44g2000cwa.goo glegroups.com.. . Are you sure that it's not attempting to wrap the next word onto the "next line" on the button, of which there is none, and shoving the "first line" up farther to compensate?
Yes it is doing that, but it does it differently depending on that FlatStyle. All I am saying is that the behavior has changed, I did not see that behavior in my apps when it was built for .NET 1.1.
-- Alan This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Lea |
last post by:
Hi,
I 've got a problem concerning the text alignment of my three input tags.
In IE6, the "login" and "ok" words are completely aligned on the bottom
border. Yet my padding is : 0px 0px 0px 1px;
Changing the line-height does not improve anything.
In FIREFOX 0.9.3, the text of the first input tag is fine. The asterisks of
the input type password are too high in text field. And finally, the text of
the third input tag is on the bottom...
|
by: harry |
last post by:
I want to be able to change the text alignment within a table cell between
"right" & "center" depending on how many rows are in the table.
Is this possible in Javascript? - can't see how to do it!
thanks
harry
|
by: Terry Brown |
last post by:
I have a problem where, depending on the text of a button, the display of
that text seems to change size or alignment.
Here is the code:
HomeScoreNameButton.ForeColor = Color.Green;
HomeScoreNameButton.Font = new System.Drawing.Font("Tahoma",
8.50F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((System.Byte)(0));
this.HomeScoreNameButton.Location = new System.Drawing.Location(10,10);
|
by: tom |
last post by:
Hi there,
In IE, I am trying to govern various style attributes of a DIV tag with
javascript.
It's no problem doing things like this: 'window.xxx.style.top="100px";'
but when I try to change the text alignment with the following:
'window.xxx.style.text-align="left";'
.... I get a syntax error probably due to the hyphen.
|
by: Bahman |
last post by:
Hello!
May be I am missing something.
In the library it says the property is called 'TextAlign' or some such
thing. But nothing works here like that.
Is the library up to date or am I looking at the 'wrong' checkbox?
Thank you for your help.
| |
by: VorTechS |
last post by:
I'm having a problem with an inherited label, applying text rotation to
aligned text.
If text rotation is applied to the aligned text, the alignment goes 'nuts'.
I can find no logic to what is happening.
I've built the following code from several examples on the web, if you
remove the rotation then alignment works fine:
Imports System.ComponentModel
|
by: Peted |
last post by:
Are there any options to enable an antialias function on standard
winform controls ?
things like the displayed text on buttons , radio buttons and other
standard controls look a bit jagged and stuff, is it possible to
antialis the text that gets entered into the text property of the
controls ?
|
by: Matthew |
last post by:
Hi,
I'm mainly a coder, PHP at the moment, but from time to time need to
design and use some css.
I've a css text alignment issue. Mostly to align text neatly in the past
I've used tables. But now I know I should be getting into the 21st C and
using css properly.
Here are 2 mock up pages with some forms on them, obviously I want the
|
by: Clancyman |
last post by:
Just putting together my site using Dreamweaver CS3. I have tested the page on IE and Safari locally and it is fine all Flash text and Buttons display and react as required. Once I upload the page and browse to it on line there are no flash text or buttons on the page !
Gerry
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |