G
Guest
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
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