Does not contain a defination for

J

Johnny E. Jensen

Hello

I have a class that inherence from the ToolStrip control called (AWToolbar),
and i added my own methods to that class.
Then i have a usercontroll (QuickNavigator), and I add the AWToolbar, by
dragging it onto the usercontrol. It works OK
At this state my InitializeComponent() looks like:


this.awToolbar1 = new Aware.WControls.AWToolbar();

this.SuspendLayout();

//

// awToolbar1

//

this.awToolbar1.Location = new System.Drawing.Point(0, 0);

this.awToolbar1.Name = "awToolbar1";

this.awToolbar1.Size = new System.Drawing.Size(148, 25);

this.awToolbar1.TabIndex = 0;

this.awToolbar1.Text = "awToolbar1";

//

// QuickNavigator

//

this.Controls.Add(this.awToolbar1);

this.Name = "QuickNavigator";

this.Load += new System.EventHandler(this.QuickNavigator_Load);

this.ResumeLayout(false);

this.PerformLayout();



As soon as i add an item to the AWToolbar I'll get this error:
'QuickNavigator' does not contain a defination for awToolbar1 and now the
initializeComponent looks like:


private void InitializeComponent()

{

System.ComponentModel.ComponentResourceManager resources = new
System.ComponentModel.ComponentResourceManager(typeof(QuickNavigator));

this.awToolbar1 = new Aware.WControls.AWToolbar();

this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();

this.awToolbar1.SuspendLayout();

this.SuspendLayout();

//

// awToolbar1

//

this.awToolbar1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {

this.toolStripButton1});

this.awToolbar1.Location = new System.Drawing.Point(0, 0);

this.awToolbar1.Name = "awToolbar1";

this.awToolbar1.Size = new System.Drawing.Size(148, 25);

this.awToolbar1.TabIndex = 0;

this.awToolbar1.Text = "awToolbar1";

//

// toolStripButton1

//

this.toolStripButton1.DisplayStyle =
System.Windows.Forms.ToolStripItemDisplayStyle.Image;

this.toolStripButton1.Image =
((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));

this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;

this.toolStripButton1.Name = "toolStripButton1";

this.toolStripButton1.Size = new System.Drawing.Size(23, 22);

this.toolStripButton1.Text = "toolStripButton1";

//

// QuickNavigator

//

this.Controls.Add(this.awToolbar1);

this.Name = "QuickNavigator";

this.Load += new System.EventHandler(this.QuickNavigator_Load);

this.awToolbar1.ResumeLayout(false);

this.awToolbar1.PerformLayout();

this.ResumeLayout(false);

this.PerformLayout();

}

And outside the InitializeComponent() this is added:
private System.Windows.Forms.ToolStripButton toolStripButton1;



Can anyone provide some help please.

Kind regards
Johnny Jensen
 
J

Johnny E. Jensen

Hello

I'll get it - It seams that every time i alter the control it automatically
removes the
defination for the AWToolbar:
private Aware.WControls.AWToolbar awToolbar1 = null;

Can anyone then tell me why it is removed? - thats strange.

Kind regards

Johnny E. Jensen said:
Hello

I have a class that inherence from the ToolStrip control called
(AWToolbar), and i added my own methods to that class.
Then i have a usercontroll (QuickNavigator), and I add the AWToolbar, by
dragging it onto the usercontrol. It works OK
At this state my InitializeComponent() looks like:


this.awToolbar1 = new Aware.WControls.AWToolbar();

this.SuspendLayout();

//

// awToolbar1

//

this.awToolbar1.Location = new System.Drawing.Point(0, 0);

this.awToolbar1.Name = "awToolbar1";

this.awToolbar1.Size = new System.Drawing.Size(148, 25);

this.awToolbar1.TabIndex = 0;

this.awToolbar1.Text = "awToolbar1";

//

// QuickNavigator

//

this.Controls.Add(this.awToolbar1);

this.Name = "QuickNavigator";

this.Load += new System.EventHandler(this.QuickNavigator_Load);

this.ResumeLayout(false);

this.PerformLayout();



As soon as i add an item to the AWToolbar I'll get this error:
'QuickNavigator' does not contain a defination for awToolbar1 and now the
initializeComponent looks like:


private void InitializeComponent()

{

System.ComponentModel.ComponentResourceManager resources = new
System.ComponentModel.ComponentResourceManager(typeof(QuickNavigator));

this.awToolbar1 = new Aware.WControls.AWToolbar();

this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();

this.awToolbar1.SuspendLayout();

this.SuspendLayout();

//

// awToolbar1

//

this.awToolbar1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {

this.toolStripButton1});

this.awToolbar1.Location = new System.Drawing.Point(0, 0);

this.awToolbar1.Name = "awToolbar1";

this.awToolbar1.Size = new System.Drawing.Size(148, 25);

this.awToolbar1.TabIndex = 0;

this.awToolbar1.Text = "awToolbar1";

//

// toolStripButton1

//

this.toolStripButton1.DisplayStyle =
System.Windows.Forms.ToolStripItemDisplayStyle.Image;

this.toolStripButton1.Image =
((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));

this.toolStripButton1.ImageTransparentColor =
System.Drawing.Color.Magenta;

this.toolStripButton1.Name = "toolStripButton1";

this.toolStripButton1.Size = new System.Drawing.Size(23, 22);

this.toolStripButton1.Text = "toolStripButton1";

//

// QuickNavigator

//

this.Controls.Add(this.awToolbar1);

this.Name = "QuickNavigator";

this.Load += new System.EventHandler(this.QuickNavigator_Load);

this.awToolbar1.ResumeLayout(false);

this.awToolbar1.PerformLayout();

this.ResumeLayout(false);

this.PerformLayout();

}

And outside the InitializeComponent() this is added:
private System.Windows.Forms.ToolStripButton toolStripButton1;



Can anyone provide some help please.

Kind regards
Johnny Jensen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top