473,485 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to reposition the text in a button control

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.

Nov 13 '05 #1
2 4031
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

"Buddy" <Bu***@Onlinework.com> wrote in message
news:0d****************************@phx.gbl...
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.


Nov 15 '05 #2

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" <Bu***@Onlinework.com>
| Sender: "Buddy" <Bu***@Onlinework.com>
| Subject: How to reposition the text in a button control
| Date: Fri, 18 Jul 2003 08:10:04 -0700
| Lines: 6
| Message-ID: <0d****************************@phx.gbl>
| 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.
|
|

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
510
by: Garibaldi | last post by:
Thanks to all... I need to read a block of text, operate on the read text then move to the next text block and so on and so on from a 650MB file. Pseudo code would be something like this: ...
2
1824
by: strout | last post by:
It's a pain to create each button with 2 images: button_on.gif button_off.gif I am looking for a control that have on/off two states, preferred as BACKGROUND images and with button text on it. ...
5
2281
by: ukrbend | last post by:
I'm trying to create a link to a certain part of a page on another website that has no anchor (i.e. ID or name) at the position on the page I want to link to. So I can't do something like ...
1
1270
by: TH | last post by:
Could anyone please explain the bizarre and utterly infuriating effect I am observing while adding controls programmatically? I've reduced the problem to the following code: <form id=Form1...
3
2195
by: Lee | last post by:
Hello, I am trying to reposition a calendar control at runtime i.e next to the approriate button which was clicked. Without the code below, the control appears in the same position but on top...
0
1849
by: David | last post by:
Hello all. I am trying to implement my first server control and have run into two problems that I cannot solve. I need the assistance of someone with more experience. My goal was to create an...
3
22510
by: GaryDean | last post by:
I have a button field in a gridview defined as follows: <asp:ButtonField ButtonType="Button" CommandName="AcceptOrder" Text="Accept Whole Order"> <ControlStyle Font-Size="X-Small" />...
0
1060
by: ChuckMac | last post by:
I have text fields with a matching search button, that get search information keyed in a field then the search button (for that text item) is pressed which caused a database search to take place. The...
1
2582
by: Bob | last post by:
Hello, Using VB 2005.net. I have a bound datagridview and a delete button control (or when the user pressed the 'Delete' key) I can successfully delete the selected record from the table and...
0
6960
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7116
Oralloy
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,...
1
6825
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7275
tracyyun
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...
0
4551
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...
0
3058
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3063
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
595
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
247
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.