Does not contain a defination for

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Johnny E. Jensen

    #1

    Does not contain a defination for

    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 InitializeCompo nent() looks like:


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

    this.SuspendLay out();

    //

    // 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.A dd(this.awToolb ar1);

    this.Name = "QuickNavigator ";

    this.Load += new System.EventHan dler(this.Quick Navigator_Load) ;

    this.ResumeLayo ut(false);

    this.PerformLay out();



    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
    initializeCompo nent looks like:


    private void InitializeCompo nent()

    {

    System.Componen tModel.Componen tResourceManage r resources = new
    System.Componen tModel.Componen tResourceManage r(typeof(QuickN avigator));

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

    this.toolStripB utton1 = new System.Windows. Forms.ToolStrip Button();

    this.awToolbar1 .SuspendLayout( );

    this.SuspendLay out();

    //

    // awToolbar1

    //

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

    this.toolStripB utton1});

    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 ";

    //

    // toolStripButton 1

    //

    this.toolStripB utton1.DisplayS tyle =
    System.Windows. Forms.ToolStrip ItemDisplayStyl e.Image;

    this.toolStripB utton1.Image =
    ((System.Drawin g.Image)(resour ces.GetObject(" toolStripButton 1.Image")));

    this.toolStripB utton1.ImageTra nsparentColor = System.Drawing. Color.Magenta;

    this.toolStripB utton1.Name = "toolStripButto n1";

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

    this.toolStripB utton1.Text = "toolStripButto n1";

    //

    // QuickNavigator

    //

    this.Controls.A dd(this.awToolb ar1);

    this.Name = "QuickNavigator ";

    this.Load += new System.EventHan dler(this.Quick Navigator_Load) ;

    this.awToolbar1 .ResumeLayout(f alse);

    this.awToolbar1 .PerformLayout( );

    this.ResumeLayo ut(false);

    this.PerformLay out();

    }

    And outside the InitializeCompo nent() this is added:
    private System.Windows. Forms.ToolStrip Button toolStripButton 1;



    Can anyone provide some help please.

    Kind regards
    Johnny Jensen


  • Johnny E. Jensen

    #2
    Re: Does not contain a defination for

    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" <jej@winner-crm.dkwrote in message
    news:%23XmrFpMQ HHA.140@TK2MSFT NGP04.phx.gbl.. .
    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 InitializeCompo nent() looks like:
    >
    >
    this.awToolbar1 = new Aware.WControls .AWToolbar();
    >
    this.SuspendLay out();
    >
    //
    >
    // 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.A dd(this.awToolb ar1);
    >
    this.Name = "QuickNavigator ";
    >
    this.Load += new System.EventHan dler(this.Quick Navigator_Load) ;
    >
    this.ResumeLayo ut(false);
    >
    this.PerformLay out();
    >
    >
    >
    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
    initializeCompo nent looks like:
    >
    >
    private void InitializeCompo nent()
    >
    {
    >
    System.Componen tModel.Componen tResourceManage r resources = new
    System.Componen tModel.Componen tResourceManage r(typeof(QuickN avigator));
    >
    this.awToolbar1 = new Aware.WControls .AWToolbar();
    >
    this.toolStripB utton1 = new System.Windows. Forms.ToolStrip Button();
    >
    this.awToolbar1 .SuspendLayout( );
    >
    this.SuspendLay out();
    >
    //
    >
    // awToolbar1
    >
    //
    >
    this.awToolbar1 .Items.AddRange (new System.Windows. Forms.ToolStrip Item[] {
    >
    this.toolStripB utton1});
    >
    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 ";
    >
    //
    >
    // toolStripButton 1
    >
    //
    >
    this.toolStripB utton1.DisplayS tyle =
    System.Windows. Forms.ToolStrip ItemDisplayStyl e.Image;
    >
    this.toolStripB utton1.Image =
    ((System.Drawin g.Image)(resour ces.GetObject(" toolStripButton 1.Image")));
    >
    this.toolStripB utton1.ImageTra nsparentColor =
    System.Drawing. Color.Magenta;
    >
    this.toolStripB utton1.Name = "toolStripButto n1";
    >
    this.toolStripB utton1.Size = new System.Drawing. Size(23, 22);
    >
    this.toolStripB utton1.Text = "toolStripButto n1";
    >
    //
    >
    // QuickNavigator
    >
    //
    >
    this.Controls.A dd(this.awToolb ar1);
    >
    this.Name = "QuickNavigator ";
    >
    this.Load += new System.EventHan dler(this.Quick Navigator_Load) ;
    >
    this.awToolbar1 .ResumeLayout(f alse);
    >
    this.awToolbar1 .PerformLayout( );
    >
    this.ResumeLayo ut(false);
    >
    this.PerformLay out();
    >
    }
    >
    And outside the InitializeCompo nent() this is added:
    private System.Windows. Forms.ToolStrip Button toolStripButton 1;
    >
    >
    >
    Can anyone provide some help please.
    >
    Kind regards
    Johnny Jensen
    >

    Comment

    Working...