Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Actually I am using PictureBox in VB.NET Windows Project and want to using alignment as Right side . So How to Set alignment of PictureBox or any other way . Can you advice how to set Right alignment ?


I paste like here . you can see as visualy for better understanding
https://plus.google.com/u/0/photos/108389872244532321380/albums/6072267770949145121/6072267774455009666?pid=6072267774455009666&oid=108389872244532321380
Posted
Comments
Sinisa Hajnal 20-Oct-14 9:23am    
I've never found anything like that. Try playing with size and zoom properties, but I think it is not possible. I'll be glad to be proven wrong.

You can program it by changing the image, add number of transparent pixels to the left so that image has exact side ratio like the picture box. Then the visible pixesl will seem aligned to the right.

1 solution

First off, don't use a picture box: if you do, then you are responsible for writing the text - and that includes you specifying exactly where the text should go.
You would probably be better off with a text based control such as a label or textbox.

If you must use a picturebox, then when you write the text you use the Graphics.DrawString[^] method, which has overloads allowing you to specify the rectange and text alignment.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900