|
Thanks for that Stumpy842
I have one more question to ask if I may.
I have a form1 that has a blank tabcontrol on it, and a form2 which the user picks a number from a combobox which then creates the tabpages on form1. Each tabpage has a number of labels on them which read from an Excel file.
Can you show me an example of how i would write the code to make it work when my form1 loads the tabpages.
I’ve been asking around (on forums mainly) but I’m getting a little confused
Many Thanks
Nick
|
|
|
|
|
Actually that's kind of outside the scope of this article. I suggest going back to the forums, be specific about what you are doing and try to post some code sample of what you've tried so far...
|
|
|
|
|
Hi, I found this code really useful. I've extended it to allow for divisions along the bar itself. The code can be found here:
SmoothProgressBar.vb
Screenshot here:
Screenshot
Cheers!
|
|
|
|
|
Wow, that's really nice! That's what I love about the extensibility of the .NET stuff, you can make it do just about whatever you want with a little tweaking. Thanks for your addition!
|
|
|
|
|
None of the above links works.
Time out, time out, time out...
... and page not found!!
It would be a great thing, when you move something,
to update all the referring links.
Thanks you.
Luca Crisi
|
|
|
|
|
Now, this is what the progress bar should have been from the beginning! Thank you Stumpy842 for posting it!
Note to those looking to take advantage of this control: Ensure that you get dbembibre's addition (also in comments) to display the current percentage. Also, make use of the demo application. It's a convenient way to come up with appropriate values for your particular needs.
|
|
|
|
|
Thank you for your comments! If anyone wants to use this control for their projects I suggest reading through all the comments posted here to get a better idea how the control can be extended, and to get more code examples. I especially like dbembibre's addition of the progress percent.
|
|
|
|
|
First of all: Great Progressbar, just nice to use.
In Addition to the suggestions made by "dbembibre", i would like to suggest my
way of adding Textdisplay to the progressbar.
My goals:
1.Texthighlighting inside the PB
2.Looking after Vertical and Reverse Display of PB
3.Additional Text (eg."(... of ... bytes)")
4.Properties that fit into your code.
Here it is (and please don´t forget to post some opinions on this one):
'//Private Variables<br />
Private mborderstyle As BorderStyle = BorderStyle.Fixed3D<br />
Private m_ProgressTextEnable As Boolean = True<br />
Private m_ProgressTextFont As System.Drawing.Font = New Font(FontFamily.GenericSansSerif, 8, FontStyle.Bold)<br />
Private m_ProgressTextColor As System.Drawing.Color = SystemColors.ControlText<br />
Private m_ProgressTextColorHighlight As System.Drawing.Color = SystemColors.HighlightText<br />
Private m_ProgressTextAdd As String<br />
<br />
'OnPaint Event<br />
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)<br />
Dim percent As Decimal = CDec(val - min) / CDec(max - min)<br />
Dim rectf As RectangleF = RectangleF.op_Implicit(Me.ClientRectangle)<br />
Dim brush<br />
<br />
Dim TextSize As SizeF<br />
Dim ProgressText As String<br />
<br />
' Draw the background of the ProgressBar control.<br />
If mbackcolorstyle = ColorStyle.Gradient Then<br />
<br />
brush = New LinearGradientBrush(rectf, _<br />
mbackcolor1, mbackcolor2, mbackgradientmode)<br />
<br />
If mbacksigmamode = SigmaMode.SigmaBell Then _<br />
brush.SetSigmaBellShape(mbacksigmafocus, mbacksigmascale)<br />
<br />
e.Graphics.FillRectangle(brush, rectf)<br />
<br />
End If<br />
<br />
' Calculate area for drawing the progress.<br />
If isHorz Then<br />
rectf.Width = rectf.Width * percent<br />
If isRevs Then rectf.X = mwidth - rectf.Width<br />
Else<br />
rectf.Height = rectf.Height * percent<br />
If Not isRevs Then rectf.Y = mheight - rectf.Height<br />
End If<br />
<br />
' Draw the progress meter.<br />
If rectf.Width > 0 AndAlso rectf.Height > 0 Then<br />
<br />
If mbarcolorstyle = ColorStyle.Solid Then<br />
brush = New SolidBrush(mbarcolor1)<br />
Else<br />
If mbargradientstretch = StretchMode.Normal Then<br />
brush = New LinearGradientBrush(Me.ClientRectangle, _<br />
mbarcolor1, mbarcolor2, mbargradientmode)<br />
Else<br />
brush = New LinearGradientBrush(rectf, _<br />
mbarcolor1, mbarcolor2, mbargradientmode)<br />
End If<br />
If mbarsigmamode = SigmaMode.SigmaBell Then _<br />
brush.SetSigmaBellShape(mbarsigmafocus, mbarsigmascale)<br />
End If<br />
<br />
e.Graphics.FillRectangle(brush, rectf)<br />
<br />
End If<br />
<br />
''/////////////BEGIN Painting the Progresstext///////////////<br />
If rectf.Width > 0 And Me.m_ProgressTextEnable = True Then<br />
ProgressText = Format((Value - min) / (max - min), "0%")<br />
<br />
Dim clipRect As Rectangle = Rectangle.Empty<br />
Dim pos As PointF = PointF.Empty<br />
Dim topGap As Integer = 0<br />
Dim g As Graphics = e.Graphics<br />
Dim sformat As New StringFormat<br />
<br />
TextSize = e.Graphics.MeasureString(ProgressText, Me.m_ProgressTextFont)<br />
<br />
If Me.BorderStyle = BorderStyle.Fixed3D Then<br />
topGap = 1<br />
End If<br />
<br />
'
If isHorz Then<br />
pos = New PointF((WorkRect.Width - TextSize.Width) / 2, (WorkRect.Height - TextSize.Height) / 2 + topGap)<br />
Else<br />
pos = New PointF((WorkRect.Width - TextSize.Height) / 2, (WorkRect.Height - TextSize.Width) / 2)<br />
End If<br />
<br />
g.Clip = New Region(rectf)<br />
<br />
If isHorz Then<br />
g.DrawString(ProgressText, Me.m_ProgressTextFont, New SolidBrush(Me.m_ProgressTextColorHighlight), pos)<br />
Else<br />
sformat.FormatFlags = StringFormatFlags.DirectionVertical<br />
g.DrawString(ProgressText, Me.m_ProgressTextFont, New SolidBrush(Me.m_ProgressTextColorHighlight), pos, sformat)<br />
End If<br />
<br />
'//Now draw the rest of the text<br />
If isHorz Then<br />
If isRevs Then<br />
clipRect = New Rectangle(Me.ClientRectangle.Left, rectf.Top, Me.ClientRectangle.Width - rectf.Width, rectf.Height)<br />
Else<br />
clipRect = New Rectangle(rectf.Left + rectf.Width, rectf.Top, Me.ClientRectangle.Width - rectf.Width, rectf.Height)<br />
End If<br />
Else<br />
If isRevs Then<br />
clipRect = New Rectangle(rectf.Left, Me.ClientRectangle.Top + rectf.Height, rectf.Width, Me.ClientRectangle.Height - rectf.Height)<br />
Else<br />
clipRect = New Rectangle(rectf.Left, Me.ClientRectangle.Top, rectf.Width, Me.ClientRectangle.Height - rectf.Height)<br />
End If<br />
End If<br />
<br />
g.Clip = New Region(clipRect)<br />
<br />
If isHorz Then<br />
g.DrawString(ProgressText, Me.m_ProgressTextFont, New SolidBrush(Me.m_ProgressTextColor), pos)<br />
Else<br />
sformat.FormatFlags = StringFormatFlags.DirectionVertical<br />
g.DrawString(ProgressText, Me.m_ProgressTextFont, New SolidBrush(Me.m_ProgressTextColor), pos, sformat)<br />
End If<br />
End If<br />
<br />
''/////////////END Painting the Progresstext///////////////<br />
<br />
<br />
If Not brush Is Nothing Then brush.Dispose()<br />
<br />
' Draw a border around the ProgressBar control.<br />
If Me.BorderStyle <> BorderStyle.None Then DrawBorder(e.Graphics)<br />
End Sub<br />
<br />
'Properties<br />
<Category("Appearance"), DefaultValue(GetType(Boolean), "True"), _<br />
Description("Enable / Disable displaying the percentage text inside the progress bar")> _<br />
Public Property ProgressTextEnable() As Boolean<br />
Get<br />
Return m_ProgressTextEnable<br />
End Get<br />
Set(ByVal Value As Boolean)<br />
m_ProgressTextEnable = Value<br />
Me.Invalidate()<br />
End Set<br />
End Property<br />
<br />
<Category("Appearance"), DefaultValue(GetType(Font), "Tahoma; 8,25pt"), _<br />
Description("Determines the font for displaying the percentage text inside the progress bar")> _<br />
Public Property ProgressTextFont() As Font<br />
Get<br />
Return m_ProgressTextFont<br />
End Get<br />
Set(ByVal Value As Font)<br />
m_ProgressTextFont = Value<br />
Me.Invalidate()<br />
End Set<br />
End Property<br />
<br />
<Category("Appearance"), DefaultValue(GetType(Color), "ControlText"), _<br />
Description("Determines the color of text displayed inside the progressbar.")> _<br />
Public Property ProgressTextColor() As Color<br />
Get<br />
Return m_ProgressTextColor<br />
End Get<br />
Set(ByVal Value As Color)<br />
m_ProgressTextColor = Value<br />
Me.Invalidate()<br />
End Set<br />
End Property<br />
<br />
<Category("Appearance"), DefaultValue(GetType(Color), "HighlightText"), _<br />
Description("Determines the inverted color of text displayed inside the progressbar.")> _<br />
Public Property ProgressTextColorHighlight() As Color<br />
Get<br />
Return m_ProgressTextColorHighlight<br />
End Get<br />
Set(ByVal Value As Color)<br />
m_ProgressTextColorHighlight = Value<br />
Me.Invalidate()<br />
End Set<br />
End Property<br />
<br />
<Category("Appearance"), DefaultValue(""), _<br />
Description("Optional text to add to the progressbar percentage text.")> _<br />
Public Property ProgressTextAdd() As String<br />
Get<br />
Return m_ProgressTextAdd<br />
End Get<br />
Set(ByVal Value As String)<br />
m_ProgressTextAdd = Value<br />
Me.Invalidate()<br />
End Set<br />
End Property
|
|
|
|
|
Forgot to add the ProgressTextAdd. Replace the following lines:
''If rectf.Width > 0 And Me.m_ProgressTextEnable = True Then<br />
ProgressText = Format((Value - min) / (max - min), "0%")<br />
<br />
If m_ProgressTextAdd <> "" Then ProgressText = ProgressText & " " & m_ProgressTextAdd
Sorry about that. :->
|
|
|
|
|
I like what you've done! However, the calculations for the clipRect need adjusted to avoid painting all the way to the edges of the control, i.e. over top of the border.
Try this code for the OnPaint handler:
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
Dim percent As Decimal = CDec(val - min) / CDec(max - min)
Dim rectf As RectangleF = RectangleF.op_Implicit(Me.ClientRectangle)
Dim brush
If mbackcolorstyle = ColorStyle.Gradient Then
brush = New LinearGradientBrush(rectf, _
mbackcolor1, mbackcolor2, mbackgradientmode)
If mbacksigmamode = SigmaMode.SigmaBell Then _
brush.SetSigmaBellShape(mbacksigmafocus, mbacksigmascale)
e.Graphics.FillRectangle(brush, rectf)
End If
If isHorz Then
rectf.Width = rectf.Width * percent
If isRevs Then rectf.X = mwidth - rectf.Width
Else
rectf.Height = rectf.Height * percent
If Not isRevs Then rectf.Y = mheight - rectf.Height
End If
If rectf.Width > 0 AndAlso rectf.Height > 0 Then
If mbarcolorstyle = ColorStyle.Solid Then
brush = New SolidBrush(mbarcolor1)
Else
If mbargradientstretch = StretchMode.Normal Then
brush = New LinearGradientBrush(Me.ClientRectangle, _
mbarcolor1, mbarcolor2, mbargradientmode)
Else
brush = New LinearGradientBrush(rectf, _
mbarcolor1, mbarcolor2, mbargradientmode)
End If
If mbarsigmamode = SigmaMode.SigmaBell Then _
brush.SetSigmaBellShape(mbarsigmafocus, mbarsigmascale)
End If
e.Graphics.FillRectangle(brush, rectf)
End If
If Not brush Is Nothing Then brush.Dispose()
If Me.BorderStyle <> BorderStyle.None Then DrawBorder(e.Graphics)
If Me.m_ProgressTextEnable Then
Dim TextSize As SizeF
Dim ProgressText As String
Dim rect, clipRect As Rectangle
Dim pos As PointF
Dim topGap As Integer
Dim g As Graphics = e.Graphics
Dim sformat As New StringFormat
ProgressText = Format((Value - min) / (max - min), "0%")
If m_ProgressTextAdd <> "" Then ProgressText &= " " & m_ProgressTextAdd
TextSize = e.Graphics.MeasureString(ProgressText, Me.m_ProgressTextFont)
rect = [Rectangle].Round(rectf)
If Me.BorderStyle = BorderStyle.None Then
topGap = 1
clipRect = Me.ClientRectangle
Else
topGap = 2
clipRect = [Rectangle].Inflate(Me.ClientRectangle, -1, -1)
End If
g.Clip = New Region([Rectangle].Intersect(rect, clipRect))
With clipRect
If isHorz Then
pos = New PointF((.Width - TextSize.Width) / 2, (.Height - TextSize.Height) / 2 + topGap)
g.DrawString(ProgressText, Me.m_ProgressTextFont, New SolidBrush(Me.m_ProgressTextColorHighlight), pos)
Else
pos = New PointF((.Width - TextSize.Height) / 2, (.Height - TextSize.Width) / 2)
sformat.FormatFlags = StringFormatFlags.DirectionVertical
g.DrawString(ProgressText, Me.m_ProgressTextFont, New SolidBrush(Me.m_ProgressTextColorHighlight), pos, sformat)
End If
End With
Dim r As New Region(clipRect)
r.Exclude(rect)
g.Clip = r
If isHorz Then
g.DrawString(ProgressText, Me.m_ProgressTextFont, New SolidBrush(Me.m_ProgressTextColor), pos)
Else
sformat.FormatFlags = StringFormatFlags.DirectionVertical
g.DrawString(ProgressText, Me.m_ProgressTextFont, New SolidBrush(Me.m_ProgressTextColor), pos, sformat)
End If
r.Dispose() : sformat.Dispose()
End If
End Sub
|
|
|
|
|
The smooth progressbar is nicely executed. The demo is actually amongst the best demos on this site to show the functionality of the control. Congrats! I look forward to your other contributions.
neuralsea
|
|
|
|
|
Thanks for the compliments! I'm glad you like my article.
|
|
|
|
|
I add code to show a percent in the progress bar.
Excuse my broken english, but im Spanish.
<br />
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)<br />
<br />
Dim percent As Decimal = CDec(val - min) / CDec(max - min)<br />
Dim rectf As RectangleF = RectangleF.op_Implicit(Me.ClientRectangle)<br />
Dim brush<br />
<br />
Dim TextSize As SizeF<br />
Dim TheCaption As String<br />
Dim RangeDiff As Double<br />
Dim sngDevide As Single<br />
Dim sngX As Single<br />
Dim sngY As Single<br />
Dim TextFont As Font = New Font(FontFamily.GenericSansSerif, 8, FontStyle.Bold)<br />
<br />
' Draw the background of the ProgressBar control.<br />
If mbackcolorstyle = ColorStyle.Gradient Then<br />
<br />
brush = New LinearGradientBrush(rectf, _<br />
mbackcolor1, mbackcolor2, mbackgradientmode)<br />
<br />
If mbacksigmamode = SigmaMode.SigmaBell Then _<br />
brush.SetSigmaBellShape(mbacksigmafocus, mbacksigmascale)<br />
<br />
e.Graphics.FillRectangle(brush, rectf)<br />
<br />
End If<br />
<br />
' Calculate area for drawing the progress.<br />
If isHorz Then<br />
rectf.Width = rectf.Width * percent<br />
If isRevs Then rectf.X = mwidth - rectf.Width<br />
Else<br />
rectf.Height = rectf.Height * percent<br />
If Not isRevs Then rectf.Y = mheight - rectf.Height<br />
End If<br />
<br />
' Draw the progress meter.<br />
If rectf.Width > 0 AndAlso rectf.Height > 0 Then<br />
<br />
If mbarcolorstyle = ColorStyle.Solid Then<br />
brush = New SolidBrush(mbarcolor1)<br />
Else<br />
If mbargradientstretch = StretchMode.Normal Then<br />
brush = New LinearGradientBrush(Me.ClientRectangle, _<br />
mbarcolor1, mbarcolor2, mbargradientmode)<br />
Else<br />
brush = New LinearGradientBrush(rectf, _<br />
mbarcolor1, mbarcolor2, mbargradientmode)<br />
End If<br />
If mbarsigmamode = SigmaMode.SigmaBell Then _<br />
brush.SetSigmaBellShape(mbarsigmafocus, mbarsigmascale)<br />
End If<br />
<br />
e.Graphics.FillRectangle(brush, rectf)<br />
<br />
End If<br />
<br />
'<br />
If rectf.Width > 0 Then<br />
' Calcular el porcentaje del progress bar<br />
RangeDiff = max - min<br />
TheCaption = Format((Value - min) / RangeDiff, "0%")<br />
<br />
' Obtener las dimensiones que necesitamos<br />
sngDevide = CSng(((Value - min) / RangeDiff) * rectf.Width)<br />
<br />
' Obtener el alto y largo del string<br />
TextSize = e.Graphics.MeasureString(TheCaption, TextFont)<br />
<br />
' Ajustar el texto al centro<br />
sngX = CType((Me.Width / 2 - TextSize.Width / 2), Single)<br />
<br />
'sngX = 1 'Sería ajuastado a la izquierda<br />
'sngX = (TheControl.Width - TextSize.Width) - 1 'Sería ajustado a la derecha<br />
<br />
sngY = (Me.Height - TextSize.Height) / 2<br />
<br />
' Dibujar el texto en el progressbar<br />
e.Graphics.DrawString(TheCaption, TextFont, New SolidBrush(Color.Orange), sngX, sngY)<br />
End If<br />
<br />
'<br />
If Not brush Is Nothing Then brush.Dispose()<br />
<br />
' Draw a border around the ProgressBar control.<br />
If Me.BorderStyle <> BorderStyle.None Then DrawBorder(e.Graphics)<br />
<br />
End Sub<br />
|
|
|
|
|
Thanks for posting your code, it works very nicely!
|
|
|
|
|
yes it's very nice, but it will be more good if a property added for the presentage like visible , color , etc
if I m asking i want to learn more and not to play, i like computer programming and advanced feature i can use.
so don't undertand my message wrongly for any reson
thanks
|
|
|
|
|
maabd wrote:
yes it's very nice, but it will be more good if a property added for the presentage like visible , color , etc
I agree, and in fact I actually changed my local copy on my computer while trying out dbembibre's modification. What I did was remove the lines which shadow the ForeColor, Font, and Text properties, and substitute these for the variables he uses to display the progress percentage:
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)<br />
<br />
Dim percent As Decimal = CDec(val - min) / CDec(max - min)<br />
Dim rectf As RectangleF = RectangleF.op_Implicit(Me.ClientRectangle)<br />
Dim brush<br />
<br />
'Dim TextFont As Font = New Font(FontFamily.GenericSansSerif, 8, FontStyle.Bold)<br />
'Dim TheCaption As String<br />
Dim TextSize As SizeF<br />
Dim RangeDiff As Double<br />
Dim sngDevide As Single<br />
Dim sngX As Single<br />
Dim sngY As Single<br />
<br />
' Draw the background of the ProgressBar control.<br />
If mbackcolorstyle = ColorStyle.Gradient Then<br />
<br />
brush = New LinearGradientBrush(rectf, _<br />
mbackcolor1, mbackcolor2, mbackgradientmode)<br />
<br />
If mbacksigmamode = SigmaMode.SigmaBell Then _<br />
brush.SetSigmaBellShape(mbacksigmafocus, mbacksigmascale)<br />
<br />
e.Graphics.FillRectangle(brush, rectf)<br />
<br />
End If<br />
<br />
' Calculate area for drawing the progress.<br />
If isHorz Then<br />
rectf.Width = rectf.Width * percent<br />
If isRevs Then rectf.X = mwidth - rectf.Width<br />
Else<br />
rectf.Height = rectf.Height * percent<br />
If Not isRevs Then rectf.Y = mheight - rectf.Height<br />
End If<br />
<br />
' Draw the progress meter.<br />
If rectf.Width > 0 AndAlso rectf.Height > 0 Then<br />
<br />
If mbarcolorstyle = ColorStyle.Solid Then<br />
brush = New SolidBrush(mbarcolor1)<br />
Else<br />
If mbargradientstretch = StretchMode.Normal Then<br />
brush = New LinearGradientBrush(Me.ClientRectangle, _<br />
mbarcolor1, mbarcolor2, mbargradientmode)<br />
Else<br />
brush = New LinearGradientBrush(rectf, _<br />
mbarcolor1, mbarcolor2, mbargradientmode)<br />
End If<br />
If mbarsigmamode = SigmaMode.SigmaBell Then _<br />
brush.SetSigmaBellShape(mbarsigmafocus, mbarsigmascale)<br />
End If<br />
<br />
e.Graphics.FillRectangle(brush, rectf)<br />
<br />
End If<br />
<br />
'<br />
If mshowpercent Then<br />
' Calcular el porcentaje del progress bar<br />
RangeDiff = max - min<br />
Me.Text = Format((Value - min) / RangeDiff, "0%")<br />
<br />
' Obtener las dimensiones que necesitamos<br />
sngDevide = CSng(((Value - min) / RangeDiff) * rectf.Width)<br />
<br />
' Obtener el alto y largo del string<br />
TextSize = e.Graphics.MeasureString(Me.Text, Me.Font)<br />
<br />
' Ajustar el texto al centro<br />
sngX = CType((Me.Width / 2 - TextSize.Width / 2), Single)<br />
<br />
'sngX = 1 'Sería ajuastado a la izquierda<br />
'sngX = (TheControl.Width - TextSize.Width) - 1 'Sería ajustado a la derecha<br />
<br />
sngY = (Me.Height - TextSize.Height) / 2<br />
<br />
' Dibujar el texto en el progressbar<br />
e.Graphics.DrawString(Me.Text, Me.Font, New SolidBrush(Me.ForeColor), sngX, sngY)<br />
End If<br />
<br />
'<br />
If Not brush Is Nothing Then brush.Dispose()<br />
<br />
' Draw a border around the ProgressBar control.<br />
If Me.BorderStyle <> BorderStyle.None Then DrawBorder(e.Graphics)<br />
<br />
End Sub
|
|
|
|
|
I'm messing around with your "change" and find that there are a couple of issues in the following code snippet:
If mshowpercent Then
' Calcular el porcentaje del progress bar
RangeDiff = max - min
Me.Text = Format((Value - min) / RangeDiff, "0%")
.
.
.
#1 ) mshowpercent is not declared. What is your declaration statement?
#2 ) Text property is originally shadowed "ReadOnly" and doesn't have a SET method. What is your modified Text property code?
TIA
-- Loungin'
|
|
|
|
|
Simply remove the ReadOnly modifier:
<browsable(false)> _
Shadows Property Text() As String
Get
Return MyBase.Text
End Get
Set(ByVal value As String)
MyBase.Text = value
End Set
End Property
Problem solved. It's still set as Browsable(False) so it's still not going to muck up the designer.
|
|
|
|
|
Hi Stumpy842!
The code in the article that hides properties form being shown in the PropertyGrid that you wrote that follows, down here, works well.
'---------------------------------------------
<Browsable(False)> _
Shadows ReadOnly Property Font() As Font
Get
Return MyBase.Font
End Get
End Property
'---------------------------------------------
But if you would like to hide the property, for example, Font, in the Code Editor in Visual Studio (when you type the name of the class.member) it does not work to apply this attribute to the property Font inherited from the Base Class:
'----------this does not work-----------------
<EditorBrowsable(EditorBrowsableState.Never)> _
Shadows ReadOnly Property Font() As Font
Get
Return MyBase.Font
End Get
End Property
'---------------------------------------------
'------------this works!----------------------
Private m_Font As Font
<EditorBrowsable(EditorBrowsableState.Never)> _
Public Property MyOwnFontProperty() As Font
Get
Return m_Font
End Get
Set(ByVal newFont As Font)
End Set
End Property
'---------------------------------------------
Have any idea on how to solve this problem...?
If you apply that atrribute to a property declared in your own class that is not inherited from any class it will work, but not to a property inherited from a Base Class.
Its even better i think not to "show" properties in Code Editor aswell as in the Property Grid if youre not going to "show/set the visibility level" of a property.
But its really a nice control with great features
|
|
|
|
|
Because Intellisense still shows the property I'm using the ReadOnly attribute in the property declaration to prevent you from writing code that sets the property's value. VB 2003 doesn't offer a way to completely hide the property in the code editor. You would think the EditorBrowsable(EditorBrowsableState.Never) would do it, but it won't hide the inherited property, just the newly declared Shadows or Overrides one. I've read that a future version of VB.NET will have support for Intellisense filtering, so I guess we'll have to wait!
I suppose you might also include the DesignOnly(True) attribute, but it's sort of redundant with the property set as ReadOnly.
|
|
|
|
|
Hi Stumpy842,
I liked your article on the gradient progress bar very much.
Though your programming language skills seem to be alot better then your French language skills, at least if you ment to read the title of your article as "A Smooth ProgressBar for everyone! Part 2" You wrote "Part Duex"... If you mean part 2 in French it should be "Deux", not Duex".
Of course you are forgiven for this, since your software is great! (And my English is probably worse than your French anyway )
Keep up the good work!
/Ger
|
|
|
|
|
Thanks for your comments! Actually I don't know any French, I just remembered the name of a movie I saw called "Hot Shots! Part Duex" so I used their (mis)spelling!
Hot Shots! Part Duex[^]:->
|
|
|
|
|
|