Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I want to dim a boolean object in the beginning of the form, as public.

 

Dim eTest as boolean = false

 

Now I want to add an event, changed to be executed when I change the state from "true" to "false" and vice-versa. Like this:

 

private sub eTestChange() handles etest.statechange

 

end sub

 

But I know that's not how I do it. How would I create an event that triggers when that memory variable is changed?

www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
  • *Experts*
Posted
You can't. Best you could do is do something like this:
Dim b As Boolean = False

Private Sub SetBool(state As Boolean)
 b = state

 'do other stuff here, that you would do in the event if such thing existed
End Sub

Then use SetBool(true) or SetBool(false) to set the boolean, rather than simply b = True or b = False.

  • *Experts*
Posted (edited)

The Value member of the scrollbar is a property, from which the event could be raised as well as the internal variable that holds the value that is returned from the property.

The way you could do what you want is using properties, just like the Value value of the scrollbar.

Edited by mutant

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...