 |
|
 |
Hello
Thanks for the code.
The rotated text can be drawn properly. but if I want to draw this rotated text in CENTER - LEFT position using string alignment, it is not drawn properly. In fact it is going out of the boundary of the control. I want to draw this rotated text in all of the string alignment position. (Top left, top center, top right, center left, center middle, center right, bottom left, bottom center, bottom right), The example shows only draw the text at one location.
|
|
|
|
 |
|
 |
Using modified label class I've managet to put it into tableLayoutPanel. However if tableLayoutPanel grows in size (many rows)
header row before I use vertical or horizontal scrollbar is ok. After I scroll down and then up to the top text gets messed up - double letters, text is painted above previous. I have suspision that this have somthing to do with OnPaint method. Seems like some kind of refresh functionality is needed.
|
|
|
|
 |
|
 |
The culprit is graphics.ClipBounds; it gets messed up if within OnPaint. Save graphics.ClipBounds in a RectangleF vaiable outside of OnPaint, each time your label is resized.
|
|
|
|
 |
|
 |
I want to use label rotation in WinCE Compact framework.
Following functions are not supported by WinCE Compact framework.
(1)graphics.TranslateTransform
(2)graphics.RotateTransform
(3)graphics.ResetTransform;
You have any alternate solution for WinCE Compact framework.
|
|
|
|
 |
|
 |
Thanks, your post helped me . i gave 5
|
|
|
|
 |
|
 |
I'm new to VB.NET from a VB6 background. I was looking for a simple way to rotate text on a label and found several solutions to code but they were too advanced for me. I found your control, figured out how to drop it in my VB project and it does exactly what I wanted. As a bonus it forced me to learn how to drop somebody else's project/control into my solution which is going to be very practical going forward.
Thanks again.
|
|
|
|
 |
|
 |
I search in several hours and found it.
Oh yes. 5 from me.
Dream it, Do it.
|
|
|
|
 |
|
 |
Would you please tell me , from where I can find control that orient text in a web page. thanks for your help.
|
|
|
|
 |
|
 |
How to orient text in a web form. This control works for window form what about web form...
as the function like OnPaint is available only in window form but not in a web form.
please guide . Thanks
|
|
|
|
 |
|
 |
Has the question of applying this to a web form, been answered?
|
|
|
|
 |
|
 |
Hi,
I need to created a custom control, where the textbox (WinForms) will be extended. When the custom control is dragged on to the form a label should get automatically added to the left of the textbox.
Thanks for all help.
Dheeraj.
|
|
|
|
 |
|
 |
can you implement in the control that it can support color, in every word inside?
what i mean is if you have and full sentence. if you want to have a certain word to be highlite or change color it can do so
thanks in advance
|
|
|
|
 |
|
 |
Please, i need some samples with how to work with rtf code, because i need to insert one picture into RichTextBox (WindowForm Component) and in the documentation no include examples...
|
|
|
|
 |
|
 |
the control is great! I've been looking for a vertical label for some time (the arc and circle are added bonuses).
but, I have a small problem. The label doesn't automatically wrap text. So, I decided to add my text at runtime using label.text="Some Short Text"+vbcrlf+"Some more short text".
Unfortunately, the label text does not align properly. the longer of the two text sequences is centered (what I want), but the shorter sequence is left aligned to the beginning of the longer sequence.
any ideas?
TIA
Lee
|
|
|
|
 |
|
 |
Could someone explain to me or reference some articles for the syntax of Entrypoints like the one below. It is from a C# wrapper that calls a function from a unmanaged C++ dll.
EntryPoint="?myFunc@myFile@@QAEH_N@Z"
I do not understand the "@@QAEH_N@Z".
Thank-you
|
|
|
|
 |
|
 |
When I choose the rotation the label it doesn't resize!
|
|
|
|
 |
|
 |
Hi,
I was looking for this functionnality and your control fits my needs, except that I've lost the TextAlign property.
The text in your control is always centered.
I'm currently only working with the rotation functionnality. Can you tell me if there is a way to change your code so as the TextAlign property is taken into account ?
Thanks a lot
David
|
|
|
|
 |
|
 |
Here is the solution I came to in the Paint event:
...
case Orientation.Rotate :
{
//For rotation, who about rotation?
double angle = (rotationAngle/180)*Math.PI;
StringFormat stringFormat = new StringFormat();
stringFormat.Trimming = StringTrimming.None;
switch (this.TextAlign)
{
case ContentAlignment.BottomLeft:
case ContentAlignment.MiddleLeft:
case ContentAlignment.TopLeft:
{
stringFormat.Alignment = StringAlignment.Near;
break;
}
case ContentAlignment.BottomCenter:
case ContentAlignment.MiddleCenter:
case ContentAlignment.TopCenter:
{
stringFormat.Alignment = StringAlignment.Center;
break;
}
case ContentAlignment.BottomRight:
case ContentAlignment.MiddleRight:
case ContentAlignment.TopRight:
{
stringFormat.Alignment = StringAlignment.Far;
break;
}
}
graphics.TranslateTransform(
(ClientRectangle.Width+(float)(height*Math.Sin(angle))-(float)(width*Math.Cos(angle)))/2,
(ClientRectangle.Height-(float)(height*Math.Cos(angle))-(float)(width*Math.Sin(angle)))/2);
graphics.RotateTransform((float)rotationAngle);
graphics.DrawString(text,this.Font,textBrush,graphics.ClipBounds, stringFormat);
graphics.ResetTransform();
break;
}
...
It seems to work so far.
David
|
|
|
|
 |
|
 |
Control is very nice... How do i get the Background Color Transparent ? Setting this Color to Transparent does not work...
Alignment code does not work for me... it just draws out of bounds...
simply weird...
|
|
|
|
 |
|
 |
Thanks for the code.
The above code added support for left, center, and right text alignment, I extended this to also support top, middle, and bottom alignment. Try this,
case Orientation.Rotate:
{
double angle = (rotationAngle / 180) * Math.PI;
stringFormat = new StringFormat();
stringFormat.Trimming = StringTrimming.None;
switch (this.TextAlign)
{
case ContentAlignment.BottomLeft:
case ContentAlignment.MiddleLeft:
case ContentAlignment.TopLeft:
{
stringFormat.Alignment = StringAlignment.Near;
break;
}
case ContentAlignment.BottomCenter:
case ContentAlignment.MiddleCenter:
case ContentAlignment.TopCenter:
{
stringFormat.Alignment = StringAlignment.Center;
break;
}
case ContentAlignment.BottomRight:
case ContentAlignment.MiddleRight:
case ContentAlignment.TopRight:
{
stringFormat.Alignment = StringAlignment.Far;
break;
}
}
graphics.TranslateTransform(
(ClientRectangle.Width + (float)(height * Math.Sin(angle)) - (float)(width * Math.Cos(angle))) / 2,
(ClientRectangle.Height - (float)(height * Math.Cos(angle)) - (float)(width * Math.Sin(angle))) / 2);
graphics.RotateTransform((float)rotationAngle);
switch (this.TextAlign)
{
case ContentAlignment.BottomLeft:
case ContentAlignment.BottomCenter:
case ContentAlignment.BottomRight:
{
graphics.TranslateClip(0, ClientRectangle.Height - height);
break;
}
case ContentAlignment.MiddleLeft:
case ContentAlignment.MiddleCenter:
case ContentAlignment.MiddleRight:
{
graphics.TranslateClip(0, ClientRectangle.Height / 2 - height / 2);
break;
}
}
graphics.DrawString(text, this.Font, textBrush, graphics.ClipBounds, stringFormat);
graphics.ResetTransform();
break;
}
|
|
|
|
 |
|
 |
Perfect! Im not too familiar with the GDI+ stuff in .NET. but i wanted to make a Button with Vertical Text! Your Article was the perfect starting point. Thanks again!!
|
|
|
|
 |
|
 |
Hi, thanks for the article.
Was wondering if you know of a textbox control that can be rotated. What I need to have is a control exactly like in Publisher or Visio, where you can rotate a textbox, and still be able to alter it.
I've tried to find out if I can somehow use graphical components like this from Publisher in C# (or anything for that matter), but know success. Any ideas??
Thanks,
Greg Schroder
|
|
|
|
 |
|
 |
Dear Sir,
I have been trying to implement you control, but without any luck, can any one help.
I'm using Visio 2002,
Jack
|
|
|
|
 |
|
 |
Hi Jack,
Can you explain bit more... What actually you want to do?
Chester
|
|
|
|
 |
|
 |
Hi Chester,
Ok, where to start
I downloaded the code, unfortunatelly i got vs2002, so i created a new project and dragged the forms, and it always gave me the same error:
>>>>>>>>>>
that the CustomControl.OrientAbleTextControls.OrientedTextLabel was not found
this is where i got confused?
??? does that help
Jack
|
|
|
|
 |