B
Bilo
I have a Windows Forms Class MainGUI
I have declared
MainGUI maingui;
public System.ComponentModel.Container components = new Container();
in the Class
I call another class MediaDriver with the Constructor
class MediaDriver
{
....
Form maingui;
private System.Windows.Forms.TrackBar trackBar1;
private System.Windows.Forms.Timer timer1;
....
public MediaDriver(Label label1 , TrackBar trackBar1 , Form maingui)
{
....
this.timer1 = new
System.Windows.Forms.Timer(this.maingui.components);
this.timer1.Enabled = true;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
....
}
But i get an error
'System.Windows.Forms.Form' does not contain a definition for 'components'
How can I solve this? How can I add a Timer for the MainGUI form in the
Class MediaDriver?
If change the Constructor to
public MediaDriver(Label label1 , TrackBar trackBar1 , MainGUI maingui)
and declare MainGUI maingui ; and not Form maingui;
than it works.
The problem is that Class MediaDriver will be a separate DLL and I dont know
the which class is calling the Constructor. When someone uses a class XYZ
and calls the Constructor of the MediaDriver than it will not work.
So I must declare the constructor like
public MediaDriver(Label label1 , TrackBar trackBar1 , Form maingui)
but than I dont know how to make a timer
I have declared
MainGUI maingui;
public System.ComponentModel.Container components = new Container();
in the Class
I call another class MediaDriver with the Constructor
class MediaDriver
{
....
Form maingui;
private System.Windows.Forms.TrackBar trackBar1;
private System.Windows.Forms.Timer timer1;
....
public MediaDriver(Label label1 , TrackBar trackBar1 , Form maingui)
{
....
this.timer1 = new
System.Windows.Forms.Timer(this.maingui.components);
this.timer1.Enabled = true;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
....
}
But i get an error
'System.Windows.Forms.Form' does not contain a definition for 'components'
How can I solve this? How can I add a Timer for the MainGUI form in the
Class MediaDriver?
If change the Constructor to
public MediaDriver(Label label1 , TrackBar trackBar1 , MainGUI maingui)
and declare MainGUI maingui ; and not Form maingui;
than it works.
The problem is that Class MediaDriver will be a separate DLL and I dont know
the which class is calling the Constructor. When someone uses a class XYZ
and calls the Constructor of the MediaDriver than it will not work.
So I must declare the constructor like
public MediaDriver(Label label1 , TrackBar trackBar1 , Form maingui)
but than I dont know how to make a timer