Me.SetStyle(ControlStyles.OptimizedDoubleBuffer Or ControlStyles.SupportsTransparentBackColor, True) TextAngle property to any angle between 0 and 359 degrees. You can add as many as you want to the Form and set their MyLabel class in the top of your ToolBox. After Building your project, you will see the If you have several labels that you want the text rotated in, then you could add a small class to your project like the one below. G.DrawString(Text, Font, Brsh, New Point(0, 0)) G.TranslateTransform(Location.X, Location.Y) Public Sub New(Text As String, Location As Point, Angle As Integer, Font As Font, ForeColour As Color)
Me.New(Text, Location, Angle, Font, Color.Black) Public Sub New(Text As String, Location As Point, Angle As Integer, Font As Font) Me.New(Text, Location, Angle, New Font("Arial", 10), Color.Black) Public Sub New(Text As String, Location As Point, Angle As Integer) Me.New(Text, Location, 0, New Font("Arial", 10), Color.Black) Public Sub New(Text As String, Location As Point) Private Sub Form1_Paint(sender As Object, e As ) Handles Me.Paint Label1 = New myLabel("Label1", New Point(50, 50)) Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load The following would serve as a starting point - try it in a new project. If you have a number of labels you may wish to create a small class to handle them and store them in a list which simplifies the paint event handler. Resetting is easiest with e.graphics.restore (Inherited from Object.The graphics transforms are cumulative so you will either need to keep track of them or reset them after drawing each label. Returns a string that represents the current object. Sets the local value of a dependency property on a DependencyObject. Returns the local value of a dependency property, if a local value is set. Returns a class-specific AutomationPeer implementation for use by the Silverlight automation infrastructure. (Inherited from DependencyObject.)Ĭreates a shallow copy of the current Object. Returns the current effective value of a dependency property from a DependencyObject. Serves as a hash function for a particular type.
Returns any base value established for a Silverlight dependency property, which would apply in cases where an animation is not active. Gets an object in the Silverlight object model by referencing the object's x:Name or Name attribute value.
(Inherited from Object.)Īllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from DependencyObject.)ĭetermines whether the specified Object is equal to the current Object. (Inherited from DependencyObject.)Ĭlears the local value of a dependency property. (Inherited from Inline.)ĭetermines whether the calling thread has access to this object. Gets or sets a value that specifies the text decorations that are applied to the content in an Inline element. Name can only be set from initial parsing of XAML. Gets or sets a unique identification for the object. Gets or sets the language of the content within an TextElement element. Gets an InlineCollection containing the top-level inline elements that include the contents of Span. Gets or sets the Brush to apply to the content in this element. Gets or sets the top-level font weight to select from the font family for the content in this element. Gets or sets the font style for the content in this element. Gets or sets the glyph width of the font in a family to select.
Gets or sets the font size for the content of the element. Gets or sets the preferred top-level font family for the content of the element. Gets a TextPointer that represents the position just before the start of the element. Gets a TextPointer that represents the position just after the end of the element. Gets the Dispatcher this object is associated with. Gets a TextPointer that represents the start of content in the element. Gets a TextPointer that represents the end of the content in the element. Gets or sets the distance between characters of text in the control measured in 1000ths of the font size.