Précision complémentaire : Genre, comme le chargement d'une page web dans IE.
"Stéphane L." a écrit dans le message de news:%
Bonjour,
Est-il possible d'intégrer 1 ProgressBar directement dans 1 StatusBarPanel
?
Merci d'avance
-- Cordialement,
Stéphane L.
Ghislain Proulx
Bonjour Stéphane,
http://minilien.com/?ZPJmH4kynx ou http://groups.google.com/groups?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=ProgressBar+StatusBar+group%3Amicrosoft%2Epublic%2Efr%2Edotnet%2E%2A
Bonne journée
Ghislain Proulx
"Stéphane L." a écrit dans le message de news:%
Bonjour,
Est-il possible d'intégrer 1 ProgressBar directement dans 1 StatusBarPanel
?
Merci d'avance
-- Cordialement,
Stéphane L.
Bonjour Stéphane,
http://minilien.com/?ZPJmH4kynx
ou
http://groups.google.com/groups?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=ProgressBar+StatusBar+group%3Amicrosoft%2Epublic%2Efr%2Edotnet%2E%2A
Bonne journée
Ghislain Proulx
"Stéphane L." <no@spam.fr> a écrit dans le message de
news:%23Iw46avcEHA.644@tk2msftngp13.phx.gbl...
Bonjour,
Est-il possible d'intégrer 1 ProgressBar directement dans 1 StatusBarPanel
http://minilien.com/?ZPJmH4kynx ou http://groups.google.com/groups?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=ProgressBar+StatusBar+group%3Amicrosoft%2Epublic%2Efr%2Edotnet%2E%2A
Bonne journée
Ghislain Proulx
"Stéphane L." a écrit dans le message de news:%
Bonjour,
Est-il possible d'intégrer 1 ProgressBar directement dans 1 StatusBarPanel
?
Merci d'avance
-- Cordialement,
Stéphane L.
Stéphane L.
Merci Ghislain
Sympa ce minilien, je ne connaissais pas :)
Je vais essayer de regarder ça à la loupe (en effet, j'ai oublié de préciser en VB).
Stéphane
"Ghislain Proulx" <http://cerbermail.com/?WdR52BEISJ> a écrit dans le message de news:%
"Stéphane L." <no@spam.fr> a écrit dans le message de
news:%23Iw46avcEHA.644@tk2msftngp13.phx.gbl...
> Bonjour,
>
> Est-il possible d'intégrer 1 ProgressBar directement dans 1
"Stéphane L." <no@spam.fr> a écrit dans le message de
news:%23Iw46avcEHA.644@tk2msftngp13.phx.gbl...
> Bonjour,
>
> Est-il possible d'intégrer 1 ProgressBar directement dans 1
Imports System Imports System.Drawing Imports System.Windows.Forms
'/ <summary> '/ Summary description for Class1. '/ </summary> Public Class ProgressStatusBar Inherits System.Windows.Forms.StatusBar
Public Sub New() Me.SizingGrip = False Me.ShowPanels = True End Sub 'New
Protected Overrides Sub OnDrawItem(ByVal sbdevent As StatusBarDrawItemEventArgs) If sbdevent.Panel.GetType() Is Type.GetType("MyStatusBar.ProgressPanel") Then Dim tmp_progressPanel As ProgressPanel = CType(sbdevent.Panel, ProgressPanel) If tmp_progressPanel.Value > tmp_progressPanel.Minimum Then Dim tmp_Width As Integer Fix(System.Convert.ToSingle(tmp_progressPanel.Value) / tmp_progressPanel.Maximum * tmp_progressPanel.Width) Dim tmp_NewBounds As Rectangle = sbdevent.Bounds Dim paintBrush As New SolidBrush(tmp_progressPanel.ForeColor) tmp_NewBounds.Width = tmp_Width sbdevent.Graphics.FillRegion(paintBrush, New [Region](tmp_NewBounds)) paintBrush.Dispose() Else MyBase.OnDrawItem(sbdevent) End If Else MyBase.OnDrawItem(sbdevent) End If End Sub 'OnDrawItem
Public Sub UpdateValue(ByVal progressPanel As ProgressPanel, ByVal newValue As Integer) progressPanel.Value = newValue Me.Refresh() End Sub 'UpdateValue
End Class 'ProgressStatusBar
Public Class ProgressPanel Inherits System.Windows.Forms.StatusBarPanel Private m_Minimum As Integer = 1 Private m_Maximum As Integer = 100 Private m_Value As Integer = 0 Private m_Color As Color
Public Sub New() Me.Style = StatusBarPanelStyle.OwnerDraw m_Color = Color.Black End Sub 'New
Public Property Minimum() As Integer Get Return m_Minimum End Get Set(ByVal Value As Integer) m_Minimum = Value End Set End Property
Public Property Maximum() As Integer Get Return m_Maximum End Get Set(ByVal Value As Integer) m_Maximum = Value End Set End Property
Public Property Value() As Integer Get Return m_Value End Get Set(ByVal Value As Integer) m_Value = Value End Set End Property
Public Property ForeColor() As Color Get Return m_Color End Get Set(ByVal Value As Color) m_Color = Value End Set End Property End Class 'ProgressPanel
> > Bonne journée > > Ghislain Proulx > > > "Stéphane L." a écrit dans le message de > news:% > > Bonjour, > > > > Est-il possible d'intégrer 1 ProgressBar directement dans 1 StatusBarPanel > ? > > > > Merci d'avance > > > > -- > > Cordialement, > > > > Stéphane L. > > > > > >
Voici la "traduction" en VB.Net...
Imports System
Imports System.Drawing
Imports System.Windows.Forms
'/ <summary>
'/ Summary description for Class1.
'/ </summary>
Public Class ProgressStatusBar
Inherits System.Windows.Forms.StatusBar
Public Sub New()
Me.SizingGrip = False
Me.ShowPanels = True
End Sub 'New
Protected Overrides Sub OnDrawItem(ByVal sbdevent As
StatusBarDrawItemEventArgs)
If sbdevent.Panel.GetType() Is Type.GetType("MyStatusBar.ProgressPanel")
Then
Dim tmp_progressPanel As ProgressPanel = CType(sbdevent.Panel,
ProgressPanel)
If tmp_progressPanel.Value > tmp_progressPanel.Minimum Then
Dim tmp_Width As Integer Fix(System.Convert.ToSingle(tmp_progressPanel.Value) /
tmp_progressPanel.Maximum * tmp_progressPanel.Width)
Dim tmp_NewBounds As Rectangle = sbdevent.Bounds
Dim paintBrush As New SolidBrush(tmp_progressPanel.ForeColor)
tmp_NewBounds.Width = tmp_Width
sbdevent.Graphics.FillRegion(paintBrush, New
[Region](tmp_NewBounds))
paintBrush.Dispose()
Else
MyBase.OnDrawItem(sbdevent)
End If
Else
MyBase.OnDrawItem(sbdevent)
End If
End Sub 'OnDrawItem
Public Sub UpdateValue(ByVal progressPanel As ProgressPanel, ByVal
newValue As Integer)
progressPanel.Value = newValue
Me.Refresh()
End Sub 'UpdateValue
End Class 'ProgressStatusBar
Public Class ProgressPanel
Inherits System.Windows.Forms.StatusBarPanel
Private m_Minimum As Integer = 1
Private m_Maximum As Integer = 100
Private m_Value As Integer = 0
Private m_Color As Color
Public Sub New()
Me.Style = StatusBarPanelStyle.OwnerDraw
m_Color = Color.Black
End Sub 'New
Public Property Minimum() As Integer
Get
Return m_Minimum
End Get
Set(ByVal Value As Integer)
m_Minimum = Value
End Set
End Property
Public Property Maximum() As Integer
Get
Return m_Maximum
End Get
Set(ByVal Value As Integer)
m_Maximum = Value
End Set
End Property
Public Property Value() As Integer
Get
Return m_Value
End Get
Set(ByVal Value As Integer)
m_Value = Value
End Set
End Property
Public Property ForeColor() As Color
Get
Return m_Color
End Get
Set(ByVal Value As Color)
m_Color = Value
End Set
End Property
End Class 'ProgressPanel
"Stéphane L." <no@spam.fr> a écrit dans le message de
news:uRuJbmycEHA.596@TK2MSFTNGP11.phx.gbl...
J'ai pas réussi à comprendre ce C# pour le mettre dans VB :
"Ghislain Proulx" <http://cerbermail.com/?WdR52BEISJ> a écrit dans le
message de news:%23WTt9YxcEHA.712@TK2MSFTNGP09.phx.gbl...
> Bonjour Stéphane,
>
> http://minilien.com/?ZPJmH4kynx
> ou
>
Imports System Imports System.Drawing Imports System.Windows.Forms
'/ <summary> '/ Summary description for Class1. '/ </summary> Public Class ProgressStatusBar Inherits System.Windows.Forms.StatusBar
Public Sub New() Me.SizingGrip = False Me.ShowPanels = True End Sub 'New
Protected Overrides Sub OnDrawItem(ByVal sbdevent As StatusBarDrawItemEventArgs) If sbdevent.Panel.GetType() Is Type.GetType("MyStatusBar.ProgressPanel") Then Dim tmp_progressPanel As ProgressPanel = CType(sbdevent.Panel, ProgressPanel) If tmp_progressPanel.Value > tmp_progressPanel.Minimum Then Dim tmp_Width As Integer Fix(System.Convert.ToSingle(tmp_progressPanel.Value) / tmp_progressPanel.Maximum * tmp_progressPanel.Width) Dim tmp_NewBounds As Rectangle = sbdevent.Bounds Dim paintBrush As New SolidBrush(tmp_progressPanel.ForeColor) tmp_NewBounds.Width = tmp_Width sbdevent.Graphics.FillRegion(paintBrush, New [Region](tmp_NewBounds)) paintBrush.Dispose() Else MyBase.OnDrawItem(sbdevent) End If Else MyBase.OnDrawItem(sbdevent) End If End Sub 'OnDrawItem
Public Sub UpdateValue(ByVal progressPanel As ProgressPanel, ByVal newValue As Integer) progressPanel.Value = newValue Me.Refresh() End Sub 'UpdateValue
End Class 'ProgressStatusBar
Public Class ProgressPanel Inherits System.Windows.Forms.StatusBarPanel Private m_Minimum As Integer = 1 Private m_Maximum As Integer = 100 Private m_Value As Integer = 0 Private m_Color As Color
Public Sub New() Me.Style = StatusBarPanelStyle.OwnerDraw m_Color = Color.Black End Sub 'New
Public Property Minimum() As Integer Get Return m_Minimum End Get Set(ByVal Value As Integer) m_Minimum = Value End Set End Property
Public Property Maximum() As Integer Get Return m_Maximum End Get Set(ByVal Value As Integer) m_Maximum = Value End Set End Property
Public Property Value() As Integer Get Return m_Value End Get Set(ByVal Value As Integer) m_Value = Value End Set End Property
Public Property ForeColor() As Color Get Return m_Color End Get Set(ByVal Value As Color) m_Color = Value End Set End Property End Class 'ProgressPanel
> > Bonne journée > > Ghislain Proulx > > > "Stéphane L." a écrit dans le message de > news:% > > Bonjour, > > > > Est-il possible d'intégrer 1 ProgressBar directement dans 1 StatusBarPanel > ? > > > > Merci d'avance > > > > -- > > Cordialement, > > > > Stéphane L. > > > > > >
Stéphane L.
Re merci Ghislain
Stéphane
"Ghislain Proulx" <http://cerbermail.com/?WdR52BEISJ> a écrit dans le message de news:
Voici la "traduction" en VB.Net...
Imports System Imports System.Drawing Imports System.Windows.Forms
'/ <summary> '/ Summary description for Class1. '/ </summary> Public Class ProgressStatusBar Inherits System.Windows.Forms.StatusBar
Public Sub New() Me.SizingGrip = False Me.ShowPanels = True End Sub 'New
Protected Overrides Sub OnDrawItem(ByVal sbdevent As StatusBarDrawItemEventArgs) If sbdevent.Panel.GetType() Is
Type.GetType("MyStatusBar.ProgressPanel")
Then Dim tmp_progressPanel As ProgressPanel = CType(sbdevent.Panel, ProgressPanel) If tmp_progressPanel.Value > tmp_progressPanel.Minimum Then Dim tmp_Width As Integer > Fix(System.Convert.ToSingle(tmp_progressPanel.Value) / tmp_progressPanel.Maximum * tmp_progressPanel.Width) Dim tmp_NewBounds As Rectangle = sbdevent.Bounds Dim paintBrush As New SolidBrush(tmp_progressPanel.ForeColor) tmp_NewBounds.Width = tmp_Width sbdevent.Graphics.FillRegion(paintBrush, New [Region](tmp_NewBounds)) paintBrush.Dispose() Else MyBase.OnDrawItem(sbdevent) End If Else MyBase.OnDrawItem(sbdevent) End If End Sub 'OnDrawItem
Public Sub UpdateValue(ByVal progressPanel As ProgressPanel, ByVal newValue As Integer) progressPanel.Value = newValue Me.Refresh() End Sub 'UpdateValue
End Class 'ProgressStatusBar
Public Class ProgressPanel Inherits System.Windows.Forms.StatusBarPanel Private m_Minimum As Integer = 1 Private m_Maximum As Integer = 100 Private m_Value As Integer = 0 Private m_Color As Color
Public Sub New() Me.Style = StatusBarPanelStyle.OwnerDraw m_Color = Color.Black End Sub 'New
Public Property Minimum() As Integer Get Return m_Minimum End Get Set(ByVal Value As Integer) m_Minimum = Value End Set End Property
Public Property Maximum() As Integer Get Return m_Maximum End Get Set(ByVal Value As Integer) m_Maximum = Value End Set End Property
Public Property Value() As Integer Get Return m_Value End Get Set(ByVal Value As Integer) m_Value = Value End Set End Property
Public Property ForeColor() As Color Get Return m_Color End Get Set(ByVal Value As Color) m_Color = Value End Set End Property End Class 'ProgressPanel
"Stéphane L." a écrit dans le message de news: > J'ai pas réussi à comprendre ce C# pour le mettre dans VB : > > "Ghislain Proulx" <http://cerbermail.com/?WdR52BEISJ> a écrit dans le > message de news:% > > Bonjour Stéphane, > > > > http://minilien.com/?ZPJmH4kynx > > ou > > >
"Ghislain Proulx" <http://cerbermail.com/?WdR52BEISJ> a écrit dans le
message de news:O5oy2MzcEHA.716@TK2MSFTNGP11.phx.gbl...
Voici la "traduction" en VB.Net...
Imports System
Imports System.Drawing
Imports System.Windows.Forms
'/ <summary>
'/ Summary description for Class1.
'/ </summary>
Public Class ProgressStatusBar
Inherits System.Windows.Forms.StatusBar
Public Sub New()
Me.SizingGrip = False
Me.ShowPanels = True
End Sub 'New
Protected Overrides Sub OnDrawItem(ByVal sbdevent As
StatusBarDrawItemEventArgs)
If sbdevent.Panel.GetType() Is
Type.GetType("MyStatusBar.ProgressPanel")
Then
Dim tmp_progressPanel As ProgressPanel = CType(sbdevent.Panel,
ProgressPanel)
If tmp_progressPanel.Value > tmp_progressPanel.Minimum Then
Dim tmp_Width As Integer > Fix(System.Convert.ToSingle(tmp_progressPanel.Value) /
tmp_progressPanel.Maximum * tmp_progressPanel.Width)
Dim tmp_NewBounds As Rectangle = sbdevent.Bounds
Dim paintBrush As New SolidBrush(tmp_progressPanel.ForeColor)
tmp_NewBounds.Width = tmp_Width
sbdevent.Graphics.FillRegion(paintBrush, New
[Region](tmp_NewBounds))
paintBrush.Dispose()
Else
MyBase.OnDrawItem(sbdevent)
End If
Else
MyBase.OnDrawItem(sbdevent)
End If
End Sub 'OnDrawItem
Public Sub UpdateValue(ByVal progressPanel As ProgressPanel, ByVal
newValue As Integer)
progressPanel.Value = newValue
Me.Refresh()
End Sub 'UpdateValue
End Class 'ProgressStatusBar
Public Class ProgressPanel
Inherits System.Windows.Forms.StatusBarPanel
Private m_Minimum As Integer = 1
Private m_Maximum As Integer = 100
Private m_Value As Integer = 0
Private m_Color As Color
Public Sub New()
Me.Style = StatusBarPanelStyle.OwnerDraw
m_Color = Color.Black
End Sub 'New
Public Property Minimum() As Integer
Get
Return m_Minimum
End Get
Set(ByVal Value As Integer)
m_Minimum = Value
End Set
End Property
Public Property Maximum() As Integer
Get
Return m_Maximum
End Get
Set(ByVal Value As Integer)
m_Maximum = Value
End Set
End Property
Public Property Value() As Integer
Get
Return m_Value
End Get
Set(ByVal Value As Integer)
m_Value = Value
End Set
End Property
Public Property ForeColor() As Color
Get
Return m_Color
End Get
Set(ByVal Value As Color)
m_Color = Value
End Set
End Property
End Class 'ProgressPanel
"Stéphane L." <no@spam.fr> a écrit dans le message de
news:uRuJbmycEHA.596@TK2MSFTNGP11.phx.gbl...
> J'ai pas réussi à comprendre ce C# pour le mettre dans VB :
>
> "Ghislain Proulx" <http://cerbermail.com/?WdR52BEISJ> a écrit dans le
> message de news:%23WTt9YxcEHA.712@TK2MSFTNGP09.phx.gbl...
> > Bonjour Stéphane,
> >
> > http://minilien.com/?ZPJmH4kynx
> > ou
> >
>
"Ghislain Proulx" <http://cerbermail.com/?WdR52BEISJ> a écrit dans le message de news:
Voici la "traduction" en VB.Net...
Imports System Imports System.Drawing Imports System.Windows.Forms
'/ <summary> '/ Summary description for Class1. '/ </summary> Public Class ProgressStatusBar Inherits System.Windows.Forms.StatusBar
Public Sub New() Me.SizingGrip = False Me.ShowPanels = True End Sub 'New
Protected Overrides Sub OnDrawItem(ByVal sbdevent As StatusBarDrawItemEventArgs) If sbdevent.Panel.GetType() Is
Type.GetType("MyStatusBar.ProgressPanel")
Then Dim tmp_progressPanel As ProgressPanel = CType(sbdevent.Panel, ProgressPanel) If tmp_progressPanel.Value > tmp_progressPanel.Minimum Then Dim tmp_Width As Integer > Fix(System.Convert.ToSingle(tmp_progressPanel.Value) / tmp_progressPanel.Maximum * tmp_progressPanel.Width) Dim tmp_NewBounds As Rectangle = sbdevent.Bounds Dim paintBrush As New SolidBrush(tmp_progressPanel.ForeColor) tmp_NewBounds.Width = tmp_Width sbdevent.Graphics.FillRegion(paintBrush, New [Region](tmp_NewBounds)) paintBrush.Dispose() Else MyBase.OnDrawItem(sbdevent) End If Else MyBase.OnDrawItem(sbdevent) End If End Sub 'OnDrawItem
Public Sub UpdateValue(ByVal progressPanel As ProgressPanel, ByVal newValue As Integer) progressPanel.Value = newValue Me.Refresh() End Sub 'UpdateValue
End Class 'ProgressStatusBar
Public Class ProgressPanel Inherits System.Windows.Forms.StatusBarPanel Private m_Minimum As Integer = 1 Private m_Maximum As Integer = 100 Private m_Value As Integer = 0 Private m_Color As Color
Public Sub New() Me.Style = StatusBarPanelStyle.OwnerDraw m_Color = Color.Black End Sub 'New
Public Property Minimum() As Integer Get Return m_Minimum End Get Set(ByVal Value As Integer) m_Minimum = Value End Set End Property
Public Property Maximum() As Integer Get Return m_Maximum End Get Set(ByVal Value As Integer) m_Maximum = Value End Set End Property
Public Property Value() As Integer Get Return m_Value End Get Set(ByVal Value As Integer) m_Value = Value End Set End Property
Public Property ForeColor() As Color Get Return m_Color End Get Set(ByVal Value As Color) m_Color = Value End Set End Property End Class 'ProgressPanel
"Stéphane L." a écrit dans le message de news: > J'ai pas réussi à comprendre ce C# pour le mettre dans VB : > > "Ghislain Proulx" <http://cerbermail.com/?WdR52BEISJ> a écrit dans le > message de news:% > > Bonjour Stéphane, > > > > http://minilien.com/?ZPJmH4kynx > > ou > > >