Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
quick question (I hope) I'm currently making a connect 4 game. To speed things up I decided to write a control array class. This class houses my add-button method and its clickhandler. Now here is my question: in my form I call my class to to generate the buttons necessary for the GUI, now how do I refrence the clickhandler from my form? I need this so that I am able populate my array with the locations the player has chosen. Any advice or links to relavant sources are greatly appreciated.
Posted

i actually work it out ;) as I expected it's a really easy fix.

Just make a new object refrence to your form:

Dim Otherfrm AS New Form2()

then change the target of the handler

AddHandler GameButton.Click, AddressOf Otherfrm.ClickHandler

 

:)

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