Hallo,
Ich hab nun mein altes Progressbarcontrol mithilfe von X-Zat überarbeitet nur zeichnet er komischerweise die Grafiken nicht.
weiß da jemand weiter ?
Da ich ja auch noch nicht soviel Ahnung von Controlls habe hoffe ich auf eure Hilfe
Ich hab nun mein altes Progressbarcontrol mithilfe von X-Zat überarbeitet nur zeichnet er komischerweise die Grafiken nicht.
weiß da jemand weiter ?
VB.NET-Quellcode
- Option Strict On
- Imports System.Drawing
- Imports System.Drawing.Drawing2D
- Imports System.ComponentModel
- Imports System.Windows.Forms
- Public Class Dll_test
- Inherits ProgressBar
- Public Sub New()
- MyBase.New()
- MyBase.SetStyle(ControlStyles.UserPaint, True) 'Der controll sagen das wir sie zeichnen
- MyBase.SetStyle(ControlStyles.AllPaintingInWmPaint, True) 'Der controll sagen das wir sie zeichnen
- MyBase.SetStyle(ControlStyles.DoubleBuffer, True) 'DoubleBuffer aktivieren
- MyBase.SetStyle(ControlStyles.SupportsTransparentBackColor, True) 'Transparente hintergrundfarbe aktivieren (für diese anwendung nicht zwingend notwendig)
- End Sub
- Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
- Dim g1 As Graphics
- Dim p As New Pen(System.Drawing.Color.Black)
- g1 = e.Graphics
- Dim R2 As Rectangle = New Rectangle(Location, New Size(Width, Height))
- With g1
- .DrawRectangle(p, R2)
- End With
- Dim R As Rectangle = New Rectangle(Location, New Size(CInt(100 / Width * Value), Height))
- With g1
- .DrawRectangle(p, R)
- End With
- g1.FillRectangle(Brushes.Orange, R)
- End Sub
- End Class
Da ich ja auch noch nicht soviel Ahnung von Controlls habe hoffe ich auf eure Hilfe