473,802 Members | 2,318 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Left-justify text using DrawString

Is it possible to left-justify, center, or right-justify text on a panel
when drawing it using DrawString?

I looked at the StringAlignment class, but all it has is far, near, and
center.

Thanks,
Robin S.
Jul 6 '07 #1
2 6685
RobinS wrote:
Is it possible to left-justify, center, or right-justify text on a
panel when drawing it using DrawString?

I looked at the StringAlignment class, but all it has is far, near,
and center.

Thanks,
Robin S.
Justify means to space the text out so both margins are even, as in the
right hand image here:

http://www.vbcorner.net/images/proje...JustifyAPI.gif

If you mean left and right *align* the text, far and near are the equivilent
to left and right align. The reason for this is that not all languages read
left-to-right, so if you are using a language, like English, that reads left
to right, near means left and far means right. If you are using a language
that reads right to left, near means right and far means left.
Jul 6 '07 #2

"Nik Coughlin" <nr******@gmail .comwrote in message
news:f6******** **@aioe.org...
RobinS wrote:
>Is it possible to left-justify, center, or right-justify text on a
panel when drawing it using DrawString?

I looked at the StringAlignment class, but all it has is far, near,
and center.

Thanks,
Robin S.

Justify means to space the text out so both margins are even, as in the
right hand image here:

http://www.vbcorner.net/images/proje...JustifyAPI.gif

If you mean left and right *align* the text, far and near are the
equivilent to left and right align. The reason for this is that not all
languages read left-to-right, so if you are using a language, like
English, that reads left to right, near means left and far means right.
If you are using a language that reads right to left, near means right
and far means left.
Thanks, Nik, for explaining that. I stuck far and near in there and they
did exactly what I wanted. Duh. Since we will be internationaliz ing our
application, it's nice to know that will work in the future, too. :-D

Robin S.
Jul 9 '07 #3

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

Similar topics

7
8430
by: Wayne Wengert | last post by:
I use statements like LEFT(textstring,6) in my app. I have "Imports Microsoft.VisualBasic" at the top of the code but to use LEFT I have to code : Microsoft.VisualBasic.Left(sting, integer) If I code just "Left" it is flagged as an error with the message "Public Overloads Property Left() As Integer has no parameters and its return type cannot be indexed"
4
4110
by: jbm05 | last post by:
Hi, I'm curious about the computational complexity of a query I have. The query contains multiple nested self left joins, starting with a simple select, then doing a self left join with the results, then doing a self left join with those results, etc. What puzzles me is that the time required for the query seems to grow exponentially as I add additional left joins, which I didn't expect. I expected the inner select to return about 25...
2
35121
by: Nathan Given | last post by:
Hello All, I am trying to debug a broken query. The query uses Left$(,4) instead of Left(,4). What is the difference between the Left() and Left$() functions in Microsoft Access? Thanks! --
18
1761
by: Jm | last post by:
Hi all I feel stupid for asking this, but i just went to use the left() function from vb6 only to find it doesnt do what it used to under .NET. Im assuming theres something else now im meant to do when i want to say for example Dim Str as string Str = "1234" msgbox left(str,2)
0
2053
by: jonipony | last post by:
HELP: Float Left box is drifting to the right in ie! -------------------------- I need som HELP with my CSS coding! On the following web page my design falls apart at screen size 800 x 600 (looks fine at larger screen sizes) when the left menu box that should float left is drifting to the right in Internet Explorer 6.0 (it doesn't drift to the right in Netscape 7.1).
8
2382
by: marco | last post by:
Hi ! I have this part of code and i can not find out why the scroller is starting from left to right instead RIGHT to LEFT. This is the main part and the scroller is working fine but from the wrong side. //------------------------------------------ function start(){if(document.getElementById){tdiv6=document.getElementById('slider'); firstns6();}
2
3148
by: tricard | last post by:
Good day all, I have a large outer joined query that I want to have some criteria. The select query is gathering all part numbers from tblPartNumbers, left joining to tblPartNumberVendor (since more than one vendor can make the part), then left joining to tblPartNumberSupplier (since more than one supplier can distribute the vendor's part), then left joining to tblPartNumberCost (since more than one cost can be associated with a single...
8
1910
by: Doron Farber | last post by:
Hi All, How can I Move the Server explorer window to the left. When ever I double click on the Server explorer top window it goes to the bottom of the IDE. Thanks, Doron
1
4041
by: naveenchhibber | last post by:
Hi all pls tell me that the following statment is valid in oracle 9i or 10g.. update ws set received_by_facility = coalesce(rbf_ouk.organizational_unit_id, 0), assigned_to_facility = coalesce(atf_ouk.organizational_unit_id, 0), received_by_team = coalesce(rbt_ouk.organizational_unit_id, 0), assigned_to_team = coalesce(att_ouk.organizational_unit_id, 0)
4
10099
by: moondaddy | last post by:
I have a wpf project where I use a canvas to drag shapes around. when I drag a shape beyond the right or bottom side I get scrollbars which is good. I also get scrollbars when I zoom in and a shape goes beyond the right or bottom side. However, I don't get scrollbars when shapes move beyond the left or top side of the canvas. This is bad. I need the behavior similar to Visio where you can drag an object past the left or top and you will...
0
9561
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10532
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, 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...
0
10302
jinu1996
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...
1
10281
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9111
agi2029
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...
1
7597
isladogs
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...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2966
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 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...

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.