"Alexia" <an*******@discussions.microsoft.com> schrieb
the code i have posted is part of the onclick event for a
button that starts the progress bar. The timer is also a
part of the progress bar as this is a custom built
control. The timer always exists for every proress bar.
There shoulkd only be one progress bar in that code i gave.
any further advise u can give?? the code u gave me....
where do i write this?? i tried to copy and paste it into
my code window but it didnt seem to like it. Could u plz
explain what it is doin? sorry, im a real beginner to all
this.
No problem, we were all beginners. :-)
You wrote: "I have just managed to create a custom smooth progress bar
control". That's why I assumed that you've already created your own class
that is directly or inderectly derived from System.Windows.Forms.Control.
The class System.Windows.Forms.Control is the base class for all controls.
Labels, Textboxes and so on are all derived from the Control class.
How to create your own controls:
http://msdn.microsoft.com/library/en...mscontrols.asp
About OOP, especially the sub topic "Inheritance":
http://msdn.microsoft.com/library/en...ithObjects.asp
These are two progress bars:
Me.SmoothProgressBar1.Value = 100
Me.SmoothProgressBar2.Value = 0
What is the type of SmoothProgressBar1 and SmoothProgressBar2? Didn't you
create them on your own?
The code I gave you is the base structure of a class. It is usually in a
separate file. Where did you paste the code?
The following lines
dim c as mycontrol
c = New MyControl 'creates the control
Me.Controls.Add(c) 'adds it to the Form
can be pasted in the Load event of the Form or in the constructor. The
constructor is Sub New in the "Windows Forms Designer generated code"
region. After calling InitializeComponents, the code can be executed. You
can also put it in a sub outside the constructor and call it in the
constructor to avoid opening the region every time you want to add code to
the constructor. Example:
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated Code "
Public Sub New()
MyBase.New()
InitializeComponent()
MyNew
End Sub
'.....
#end region
private Sub MyNew
dim c as mycontrol
c = New MyControl 'creates the control
Me.Controls.Add(c) 'adds it to the Form
end sub
'......
End Class
I hope this helps because I still didn't fully understand the structure of
your current project. Please ask again if something's not clear.
--
Armin
http://learn.to/quote http://www.plig.net/nnq/nquote.html