473,626 Members | 3,369 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

11th hour failure to trigger click event for object in hash table

Someone else had a question on how to emulate a mouse click. I tried posting
in that thread but I have something of a twist on this problem and I'm
really in trouble here! If I don't get help soon, I'm going to fail this
class and the class is already dragging down my GPA. I'm taking an
introductory visual basic class with an advanced visual basic book and
assignments (the department dropped the prerequisite and the class needs one.
I've taken some programming but this isn't programming and you can't find
the code that you need because half the time the answer isn't even in the
code!)

If this is a dumb question, that's because I'm a student in a 200 level
Visual Basic class. I did try the local help, and search for similar
problems, and look in the book, and ask my school's help desk (none of them
know Visual Basic and the tutoring center is closed)

I'm supposed to make a gomokuo game, including a
computer strategy, as well as a computer random player.

The game board consists of 36 picture boxes. I added them all to a hash table
(BTW, don't know if it matters but the way the keys are set up, the row is
in the tens and the column is in the ones)

I just finished the logic for the computer strategy. I thought the random
player part would be easy.

At the last minute, I tested it and realized that the code that I had to
trigger the
click event subroutine did not work.

The problem is that the sender is supposed to be a member of a hash table. I
need to trigger a sub called "gpic_click ," which is the event handler for
the click events of the 36 picture boxes. I need to trigger it with the
correct
picture box (i.e. hashboard(key)) as the sender.

So I need to trigger the click event itself.

I was using hashboard(key). click but that didn't work.

I even tried making a case selection structure

"Select case key
case 11
gpic11.click"
etc.

and that won't even work because the subroutine isn't called gpic11_click
or gpicc25_click, it's one subroutine that handles a lot of click events, and
the instructions were to call the click event handler subroutine for that
particular object and I need to be able to do this without a case selection
structure and 36 copies of the click subroutine.

I just tried duplicating the subroutine and it won't even let me do that!
I can't call a subroutine in the SAME CLASS! It wants an argument and I
have no idea what to put there and it won't tell me and the information is
totally unavaialable and I can't get anyone to help me because everyone's too
good for Visual Basic.

I have a little more than three hours until my academic career, which is the
single most important thing in my life, goes down the toilet because of this!
PLEASE HELP!

TIA
Dec 11 '06 #1
4 1836
LyzH <Ly**@discussio ns.microsoft.co mwrote:
>It wants an argument and I
have no idea what to put there and it won't tell me and the information is
totally unavaialable
At this point we have even less information than you about what that
function is and what argument it expects. At least give us a hint!

--
Lucian
Dec 11 '06 #2
Quite an explanation. Hope there is still some time left... realize "you're
doing it wrong" :-) but this will work.

A click event handler is a function like any other so you can call it
directly. The problem only occurs if you intend to reference the parameters
since a "click event" never happened so clearly what got clicked needs to be
supplied by you.

If your control handler is named gpic_click() it is expecting (I imagine) a
"sender" (System.Object) and an "e" (System.EventAr gs). So to simulate a
click on gpic11 you call gpic_click( gpic11, New System.EventArg s)

Good luck.

Tom
"LyzH" <Ly**@discussio ns.microsoft.co mwrote in message
news:4E******** *************** ***********@mic rosoft.com...
Someone else had a question on how to emulate a mouse click. I tried
posting
in that thread but I have something of a twist on this problem and I'm
really in trouble here! If I don't get help soon, I'm going to fail this
class and the class is already dragging down my GPA. I'm taking an
introductory visual basic class with an advanced visual basic book and
assignments (the department dropped the prerequisite and the class needs
one.
I've taken some programming but this isn't programming and you can't find
the code that you need because half the time the answer isn't even in the
code!)

If this is a dumb question, that's because I'm a student in a 200 level
Visual Basic class. I did try the local help, and search for similar
problems, and look in the book, and ask my school's help desk (none of
them
know Visual Basic and the tutoring center is closed)

I'm supposed to make a gomokuo game, including a
computer strategy, as well as a computer random player.

The game board consists of 36 picture boxes. I added them all to a hash
table
(BTW, don't know if it matters but the way the keys are set up, the row
is
in the tens and the column is in the ones)

I just finished the logic for the computer strategy. I thought the
random
player part would be easy.

At the last minute, I tested it and realized that the code that I had to
trigger the
click event subroutine did not work.

The problem is that the sender is supposed to be a member of a hash table.
I
need to trigger a sub called "gpic_click ," which is the event handler for
the click events of the 36 picture boxes. I need to trigger it with the
correct
picture box (i.e. hashboard(key)) as the sender.

So I need to trigger the click event itself.

I was using hashboard(key). click but that didn't work.

I even tried making a case selection structure

"Select case key
case 11
gpic11.click"
etc.

and that won't even work because the subroutine isn't called gpic11_click
or gpicc25_click, it's one subroutine that handles a lot of click events,
and
the instructions were to call the click event handler subroutine for that
particular object and I need to be able to do this without a case
selection
structure and 36 copies of the click subroutine.

I just tried duplicating the subroutine and it won't even let me do that!
I can't call a subroutine in the SAME CLASS! It wants an argument and I
have no idea what to put there and it won't tell me and the information is
totally unavaialable and I can't get anyone to help me because everyone's
too
good for Visual Basic.

I have a little more than three hours until my academic career, which is
the
single most important thing in my life, goes down the toilet because of
this!
PLEASE HELP!

TIA

Dec 12 '06 #3
Thanks for getting back to me. Sorry I'm a little panicked.

At this point, I created a different subroutine to do all of the things that
the click routine does. The computer gets its very own subroutine because it
refuses to click.

What the functions are is:
When someone clicks on one of 36 picture boxes (enumerated in the "handles"
clause of the heading of the subroutine)

Change the tag property of the sender. (the tag holds a 0 for empty square,
1 for square controlled by player 1, or 2 for square controlled by player 2)

Change the image displayed by the sender.

In the case of the computermove subroutine that I wrote, the square
corresponding to the key value passed "hashboard(key) " takes the place of
sender. I know that a reference to that works because I use a "for each" to
reset the images when user presses the "new game" button.

--------------------

However, I can't pass anything from the business tier or to the business
tier and it wants me to create a new instance of the business tier every time
I refer to it.

The business tier can access friend declared variables from the presentation
tier (the game board or the opening screen) but a public property of the
business tier is "a non-shared member," as are public variables and subs of
the business tier.

I don't know why but "public" and "friend" don't appear to mean the same
things when I try to use them.

It tells me I need an object reference. I look up object reference and
non-shared member, and the help tells me that, if I have a non-shared member,
I need an object reference. That is so typical of Microsoft's "help."

My book explains nothing. The index contains neither term.

I have 21 minutes. The help desk is saying the lab will be open tomorrow but
there are notices posted _everywhere_ saying that it will not be.

Again, thanks
Lyz
"Lucian Wischik" wrote:
LyzH <Ly**@discussio ns.microsoft.co mwrote:
It wants an argument and I
have no idea what to put there and it won't tell me and the information is
totally unavaialable

At this point we have even less information than you about what that
function is and what argument it expects. At least give us a hint!

--
Lucian
Dec 12 '06 #4
Thanks; that is what I wanted to know.

Now my only problem is to deal with the fact that I have a seperate class
for the
computer strategy and it hangs at the point where it is supposed to call a
public function from that class.

It doesn't throw an exception or anything, it just stops.

Gotta go. Lab closing. Will be open tomorrow, I hope.

Thanks.
"Tom Leylan" wrote:
Quite an explanation. Hope there is still some time left... realize "you're
doing it wrong" :-) but this will work.

A click event handler is a function like any other so you can call it
directly. The problem only occurs if you intend to reference the parameters
since a "click event" never happened so clearly what got clicked needs to be
supplied by you.

If your control handler is named gpic_click() it is expecting (I imagine) a
"sender" (System.Object) and an "e" (System.EventAr gs). So to simulate a
click on gpic11 you call gpic_click( gpic11, New System.EventArg s)

Good luck.

Tom
"LyzH" <Ly**@discussio ns.microsoft.co mwrote in message
news:4E******** *************** ***********@mic rosoft.com...
Someone else had a question on how to emulate a mouse click. I tried
posting
in that thread but I have something of a twist on this problem and I'm
really in trouble here! If I don't get help soon, I'm going to fail this
class and the class is already dragging down my GPA. I'm taking an
introductory visual basic class with an advanced visual basic book and
assignments (the department dropped the prerequisite and the class needs
one.
I've taken some programming but this isn't programming and you can't find
the code that you need because half the time the answer isn't even in the
code!)

If this is a dumb question, that's because I'm a student in a 200 level
Visual Basic class. I did try the local help, and search for similar
problems, and look in the book, and ask my school's help desk (none of
them
know Visual Basic and the tutoring center is closed)

I'm supposed to make a gomokuo game, including a
computer strategy, as well as a computer random player.

The game board consists of 36 picture boxes. I added them all to a hash
table
(BTW, don't know if it matters but the way the keys are set up, the row
is
in the tens and the column is in the ones)

I just finished the logic for the computer strategy. I thought the
random
player part would be easy.

At the last minute, I tested it and realized that the code that I had to
trigger the
click event subroutine did not work.

The problem is that the sender is supposed to be a member of a hash table.
I
need to trigger a sub called "gpic_click ," which is the event handler for
the click events of the 36 picture boxes. I need to trigger it with the
correct
picture box (i.e. hashboard(key)) as the sender.

So I need to trigger the click event itself.

I was using hashboard(key). click but that didn't work.

I even tried making a case selection structure

"Select case key
case 11
gpic11.click"
etc.

and that won't even work because the subroutine isn't called gpic11_click
or gpicc25_click, it's one subroutine that handles a lot of click events,
and
the instructions were to call the click event handler subroutine for that
particular object and I need to be able to do this without a case
selection
structure and 36 copies of the click subroutine.

I just tried duplicating the subroutine and it won't even let me do that!
I can't call a subroutine in the SAME CLASS! It wants an argument and I
have no idea what to put there and it won't tell me and the information is
totally unavaialable and I can't get anyone to help me because everyone's
too
good for Visual Basic.

I have a little more than three hours until my academic career, which is
the
single most important thing in my life, goes down the toilet because of
this!
PLEASE HELP!

TIA


Dec 12 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1565
by: nosbtr1 | last post by:
When a row gets modified and it invokes a trigger, we would like to be able to update the row that was modified inside the trigger. This is (basically) how we are doing it now: CREATE TRIGGER trTBL ON TBL FOR UPDATE, INSERT, DELETE as update TBL set fld = 'value' from inserted, TBL
2
11357
by: kj | last post by:
How does one trigger an event programmatically? I'm interested in how to do this in both the "Level 0" event model as well as in the DOM Level 2 event model. Thanks! kj -- NOTE: In my address everything before the first period is backwards; and the last period, and everything after it, should be discarded.
9
5727
by: VK | last post by:
My original idea of two trains, however pictural it was, appeared to be wrong. The truth seems to be even more chaotic. IE implements its standard down-up model: any mouse event goes from the deepest visible element to the top. By carefully studying fromElement and toElement properties, one can handle events on any point of their way up. NN/FF implements a "Russian hills" style: mouse events go first up->down (window->deepest...
1
5405
by: Mike | last post by:
I have a form that I am using Condiftional formatting to create a dashboard to indicate if there are records for each weekday of the selected week. I have inserted requery commands on AfterUpdate events of the fields, but the nature of the lookups that I am using for the conditonal formatting need to be requeried once the record is saved. Is there a way to trigger a requery when the save button is clicked? I would think that it would be...
0
1895
by: OceanBreeze | last post by:
I have added a LinkButton to a table cell programmatically inside the Page_Load method. I also added a custom event to that link button. The same custom event is valid for all the link buttons. The table gets successfully displayed on the browser with the LinkButton. When I click on the link button in the browser, my control does not go inside the custom even that I wrote for the link button. I have a table control as ProviderTbl in which...
3
2219
by: Terry | last post by:
Hi, I have a button ("button1") embedded into another control ("LoginView1"). In the code-behind environment of VWD (visual web dev.), i cant' use the event button1_onclick because 'button1' doesn't appear in the list of the events. How can i then trigger an action when clicking the button?
0
2625
by: wugon.net | last post by:
Hi , Anyone know how to monitor db2 trigger activity ? We suffer some trigger issue today and we try to monitor trigger's behavior use event monitor and db2audit, but both tools can not get trigger's sql statment and cost, have other tools can get trigger's executing sql statment and cost ? our test case as follow: Env:
1
7003
by: daonho | last post by:
I tried to use javascript to trigger up the button click function when user press enter key from the textbox. This function work fine with a single button click such has login page. However, if the page has multiple button such login page with a search function somewhere around, then it's not respond properly. I have attached a brief example of two text boxes and two button. When ever a key is press on textbox one, I want to trigger...
5
4932
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums there are, it crashes. There are currently 6 columns, and I only want 4. How do I remove the last two (discount and date)? Here is a link: http://www.jaredmoore.com/tablesorter/docs/salestable.html Here is some jquery js that I think...
0
8196
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8637
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5574
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4092
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2625
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1808
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.