473,387 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problem in right align of the text

(Type your message here)

----------(Type your message here)
Hi
I want to align the text to be printed to be right aligned. I used stringalignment.far property but it instead started printing vertically from up to down.. While near and center seems to work fine.

BoxRectangle = New System.Drawing.RectangleF(Left, top, Width, Height)
AlignmentLabel = New System.Drawing.StringFormat(System.Drawing.StringA lignment.Far)
e.Graphics.DrawString(Value, FontLabel, System.Drawing.Brushes.Black, BoxRectangle, AlignmentLabel)

I am not able to find any reason for this ..hope someone will help me in solving this problem

Thanks
--------------------------------

From: Harpreet Singh

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>Y/9dk2oA40SnTXkMKFLZQg==</Id>
Nov 20 '05 #1
1 1326
On Sun, 13 Jun 2004 13:01:09 -0700, Harpreet Singh via .NET 247
<an*******@dotnet247.com> wrote:

:
I want to align the text to be printed to be right aligned. I used stringalignment.far property but it instead started printing vertically from up to down.. While near and center seems to work fine.

BoxRectangle = New System.Drawing.RectangleF(Left, top, Width, Height)
AlignmentLabel = New System.Drawing.StringFormat(System.Drawing.StringA lignment.Far)
e.Graphics.DrawString(Value, FontLabel, System.Drawing.Brushes.Black, BoxRectangle, AlignmentLabel)

I am not able to find any reason for this ..hope someone will help me in solving this problem

Thanks
--------------------------------

From: Harpreet Singh

:

Try (untested):

BoxRectangle = New System.Drawing.RectangleF(Left, top, Width, Height)
SF = New System.Drawing.StringFormat()
SF.Alignment=System.Drawing.StringAlignment.Far
e.Graphics.DrawString(Value, FontLabel, System.Drawing.Brushes.Black,
BoxRectangle, SF)

You appear to be using the wrong parameter type on the StringFormat
Constructor.
I bet you have set "Option Strict Off"?

Michael
Nov 20 '05 #2

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

Similar topics

3
by: redneck_kiwi | last post by:
Hi all: I have a really weird problem. I am developing a customer catalog system for my company and as such have delved into sessions for authentication and access levels. So far, I have managed...
5
by: comshiva | last post by:
Hi all, I have converted my existing ASP.NET project from 1.1 to 2.0 and i have found that everything works fine except the linkbutton control in my datagrid which throws an javascript error when...
1
by: books1999 | last post by:
Hi there, I have a problem with this css/div and i cannot work it out. I would like either container to be able to push the background box to grow but in Firefox it overflows. Can someone find a...
2
by: DC | last post by:
The Code <%@ import namespace="System" %> <%@ import namespace="System.Web" %> <%@ import namespace="System.Web.UI" %> <%@ import namespace="System.Web.UI.HtmlControls" %> <%@ import...
1
by: Trev | last post by:
Hi, I'm hoping that someone in this group can shed some light on an issue I'm having with a Formview. I have a Web User Control (.ascx) with a Formview. The Formview contains 2 Multiviews,...
5
by: althafexcel | last post by:
hi everyone Im trying to include an external js in my aspx page under the head tag, it doesn't load or it displays an object expected error whenver the function from the .js is called. Actually...
0
by: sjickells | last post by:
Hi I am having a problem using asp:TextBox's in a transparent table. I have a background image on the page and a table in the middle of the page. I have set the background colour of the table...
0
by: radhi | last post by:
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <html:html>...
1
by: sravani1 | last post by:
This code runs like when i submit the form it takes the image and displayed and top of the image a map will displayed. But actually i want that when i give the image it checks the location in the map...
1
by: innivive | last post by:
I am having a problem with having margins display correctly in IE7, Firefox and Safari. I am not sure if it is the "double margin error" or something else. Any help would be appreciated. The file...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.