how to Access Module variable in ToolStripMenuItem_Click Event

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2009
Posts: 4
Reputation: kasimacsys is an unknown quantity at this point 
Solved Threads: 0
kasimacsys kasimacsys is offline Offline
Newbie Poster

how to Access Module variable in ToolStripMenuItem_Click Event

 
0
  #1
Jul 7th, 2009
I have declare a array variable in module, i need to access this variable to ToolStripMenuItem_Click Event. but i can't, when type that variable it shows "Class 'System.Windows.Forms.ToolStripMenuItem' cannot be indexed because it has no default property"

Please anyone help me
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 710
Reputation: Teme64 will become famous soon enough Teme64 will become famous soon enough 
Solved Threads: 114
Teme64's Avatar
Teme64 Teme64 is offline Offline
Master Poster

Re: how to Access Module variable in ToolStripMenuItem_Click Event

 
0
  #2
Jul 7th, 2009
I have declare a array variable in module, i need to access this variable to ToolStripMenuItem_Click Event.
Declare the array public. For example, Public MyArray() As Integer
when type that variable it shows "Class 'System.Windows.Forms.ToolStripMenuItem' cannot be indexed because it has no default property"
You're trying to access ToolStripMenuItem's item with a code similar to ctlToolStrip(0) . Change it to ctlToolStrip.Items.Item(0)

HTH
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 4
Reputation: kasimacsys is an unknown quantity at this point 
Solved Threads: 0
kasimacsys kasimacsys is offline Offline
Newbie Poster

Re: how to Access Module variable in ToolStripMenuItem_Click Event

 
0
  #3
Jul 7th, 2009
hi dear,
i declare the variable as public only... i want to use this variable in mdi form ToolStripMenuItem_Click event...
ie) before i show any form, i need to check the variable

for example,
i declare in module like
" Public Menu_201(1000) As String
and access in mdi form "ToolStripMenuItem_Click event" like
if Menu_201(201)="ABC" then
some thing i need to write here
end if
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 710
Reputation: Teme64 will become famous soon enough Teme64 will become famous soon enough 
Solved Threads: 114
Teme64's Avatar
Teme64 Teme64 is offline Offline
Master Poster

Re: how to Access Module variable in ToolStripMenuItem_Click Event

 
0
  #4
Jul 7th, 2009
" Public Menu_201(1000) As String
Quote ("-character) was a typing error, right?

i declare the variable as public only
If you've declared that array as public it is visible to your form(s).

i want to use this variable in mdi form ToolStripMenuItem_Click event...
ie) before i show any form, i need to check the variable
How is it raised or what does raise that click-event?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC