Jump to content
Xtreme .Net Talk

Accessing form controls within a class?


Recommended Posts

Guest Morgon
Posted

I have a class that's called whenever a user clicks a button on the form.. some info goes into a listbox, and everything's fine "While" the current thread is alive.. well, when things cease to be fine, I want this class to remove the item from the listbox.. however.. directly accessing lstCameras.Items.Remove() results in "Reference to a non-shared member requires an object reference" ...So my question is.. how do I either share it, or make an object reference? I tried making a public function that would remove it, but it didn't like that either... so now I'm stuck -- can anyone help? :)

 

-Morgon

Guest Morgon
Posted
Mmkay.. errr.. how would I do that? :-D
Guest Morgon
Posted
Well in the class, it's doing an If statement within a While .... so during the whole class' lifetime, theoretically (am I explaining that right?) .. Basiaclly, if the condition is False from that If statement, then it needs to remove something from the listbox.
  • *Gurus*
Posted

Sounds like the Constructor might be the way to go. Please take

my advice with a grain of salt. My .Net skills are very early in

development, and this advice is a combination of what I know

about .net classes, and what I know about OO programming with

VB in general.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...