How to reposition the text in a button control

B

Buddy

Hello,

Can someone point me to some example code that shows how
to paint the text in a button control. I basically want to
reposition the text so it does not wrap.
 
M

MikeY

Hi Buddy,

Depends on how you are creating your button. I presume you are using windows
forms. If so, then try TextAlignment properties, ImageAlignment, and Font
properties. If you are using Dynamic controls then it's pretty much the same
thing, except you will have to go in your code and manually adjest the code.
Sorry I have no example for you, but you could always try
http://www.gotdotnet.com/ which seems like a pretty cool site for samples.

MikeY
 
J

Jeffrey Tan[MSFT]

Hi Buddy,

MikeY provided a simply way of controling the text alignment of button
control.
But I think the funtion provided by Button's text alignment property is too
limited.
If you want to get more control over the button, you can override the
wndproc of
the form then subclass the button's wndproc, then you can control the
button text at your pleasure.

Hope it helps.


Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Buddy" <[email protected]>
| Sender: "Buddy" <[email protected]>
| Subject: How to reposition the text in a button control
| Date: Fri, 18 Jul 2003 08:10:04 -0700
| Lines: 6
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcNNPqriW72z/k4lQFet1s7Fd4xsKA==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:170213
| NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hello,
|
| Can someone point me to some example code that shows how
| to paint the text in a button control. I basically want to
| reposition the text so it does not wrap.
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top