12 Replies - 6041 Views - Last Post: 17 January 2013 - 01:58 PM Rate Topic: ***-- 2 Votes

#1 ontheoldman  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 8
  • Joined: 17-January 13

Visual basics2010 coding- How do I make my button when clicked...

Posted 17 January 2013 - 10:19 AM

Basically I'm trying to make a quiz for children and I have a question button but when I click it I need it to pick a non repeated image id and sound that is matched to it. Once clicked as well I need the buttons enabled. Also would appreciate if someone could tell me what code I need to use so that when they click the right button it comes up with that they got it correct and when they've got it wrong to say that got it wrong and highlight the right answer. All has to be for visual basics 2010 sourcing code for a html page. I have all the sound ID's and image id's etc. there's an option of seven animals. Thank you :)/>

Is This A Good Question/Topic? 0
  • +

Replies To: Visual basics2010 coding- How do I make my button when clicked...

#2 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3319
  • View blog
  • Posts: 11,224
  • Joined: 12-December 12

Re: Visual basics2010 coding- How do I make my button when clicked...

Posted 17 January 2013 - 10:37 AM

What code do you have so far?
Was This Post Helpful? 0
  • +
  • -

#3 ontheoldman  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 8
  • Joined: 17-January 13

Re: Visual basics2010 coding- How do I make my button when clicked...

Posted 17 January 2013 - 12:28 PM

View Postandrewsw, on 17 January 2013 - 10:37 AM, said:

What code do you have so far?

So far I have
<head>
    <title>Garden Animals</title>
</head>
  <body>
    <p><b>Garden animals</b></p> 

  </body>

<input id="Question" type="button" value="?" />
<p> </body>
  <input id="Damselfly" type="button" value="Animal 1" />
  <img id="Damselfly" src="AnimalDamselfly.jpg" style= "width:100px; height:100px" />
  <input id="Frog" type="button" value="Animal 2" />
  <img id="Frog" src="AnimalFrog.jpg" style= "width:100px; height:100px" />
  <input id="Newt" type="button" value="Animal 3" />
  <img id="Newt" src="AnimalNewt.jpg" style= "width:100px; height:100px" />  
  <input id="Hedgehog" type="button" value="Animal 4" />
  <img id="Hedgehog" src="AnimalHedgehog.jpg" style= "width:100px; height:100px"/>
  <input id="Slowworm" type="button" value="Animal 5" />
  <img id="Slowworm" src="AnimalSlowworm.jpg" style= "width:100px; height:100px"/>
  <input id="Thrush" type="button" value="Animal 6" />
  <img id="Thrush" src="AnimalThrush.jpg" style= "width:100px; height:100px"/>
  <input id="Tortoiseshell" type="button" value="Animal 7" />
  <img id="Tortoiseshell" src="AnimalTortoiseshell.jpg" style= "width:100px; height:100px"/> </p>
   Feedback:<br /> 
   <textarea rows="6" cols="50"></textarea><br />
   Rating of my website:
   <img id="GreyStar" src="StarOff.gif" style= "width:75px; height:75px"/>
   <img id="Img1" src="StarOff.gif" style= "width:75px; height:75px"/>
   <img id="Img2" src="StarOff.gif" style= "width:75px; height:75px"/>
   <img id="Img3" src="StarOff.gif" style= "width:75px; height:75px"/>
   <img id="Img4" src="StarOff.gif" style= "width:75px; height:75px"/>




  </html>






<script language="VBScript"
  
Sub btnQuestion_onclick()


This post has been edited by macosxnerd101: 17 January 2013 - 01:35 PM
Reason for edit:: Please use code tags.

Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9048
  • View blog
  • Posts: 33,970
  • Joined: 12-June 08

Re: Visual basics2010 coding- How do I make my button when clicked...

Posted 17 January 2013 - 12:33 PM

So what.. you hard coded everything? Perhaps you should investigate looking into using a database or some local data store.. and then you can load records that contain the image, name, and sound instead of keep adding to a static page.
Was This Post Helpful? 0
  • +
  • -

#5 ontheoldman  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 8
  • Joined: 17-January 13

Re: Visual basics2010 coding- How do I make my button when clicked...

Posted 17 January 2013 - 12:41 PM

I have the hard coding yeah but I don't understand how to make things active etc. I've tried looking at videos online hours on end but most of them are using it for a project not an online quiz. I don't understand what I need to write for the Sub Button on click? Do I then put Button on click Rnd id? and then how does the If statements work if they click on the wrong one? Do I put when img id hedgehog click play sound blah blah blah? I really don't understand :(. I need it to go to a non repeating image that I have chosen and a matching sound with the buttons being enabled. I have the Id for the sounds.
Was This Post Helpful? 0
  • +
  • -

#6 ontheoldman  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 8
  • Joined: 17-January 13

Re: Visual basics2010 coding- How do I make my button when clicked...

Posted 17 January 2013 - 01:40 PM

So no one can help...
Was This Post Helpful? -1
  • +
  • -

#7 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9048
  • View blog
  • Posts: 33,970
  • Joined: 12-June 08

Re: Visual basics2010 coding- How do I make my button when clicked...

Posted 17 January 2013 - 01:41 PM

Quote

I don't understand how to make things active etc.

I have zero idea what you mean by 'active'. Is that like enabled/disabled?

Quote

I don't understand what I need to write for the Sub Button on click?

I would suggest starting over. *READ* up on how to work with a database and an asp.net form. Learn about how to make at table to hold the image, sound, question, right answer, etc... and then design a control in ASP to accommodate that.

Quote

Do I then put Button on click Rnd id

I have no idea what this means.

Quote

and then how does the If statements work if they click on the wrong one?

Clicks wrong one what?

Quote

Do I put when img id hedgehog click play sound blah blah blah

I have no idea what this means.

Quote

I really don't understand

I understand how that goes.
Was This Post Helpful? 0
  • +
  • -

#8 ontheoldman  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 8
  • Joined: 17-January 13

Re: Visual basics2010 coding- How do I make my button when clicked...

Posted 17 January 2013 - 01:45 PM

View Postmodi123_1, on 17 January 2013 - 01:41 PM, said:

Quote

I don't understand how to make things active etc.

I have zero idea what you mean by 'active'. Is that like enabled/disabled?

Quote

I don't understand what I need to write for the Sub Button on click?

I would suggest starting over. *READ* up on how to work with a database and an asp.net form. Learn about how to make at table to hold the image, sound, question, right answer, etc... and then design a control in ASP to accommodate that.

Quote

Do I then put Button on click Rnd id

I have no idea what this means.

Quote

and then how does the If statements work if they click on the wrong one?

Clicks wrong one what?

Quote

Do I put when img id hedgehog click play sound blah blah blah

I have no idea what this means.

Quote

I really don't understand

I understand how that goes.

Thanks for that basically all I needed to hear from you was that you can't help... No need to be patronising. If you don't know how to help then don't bother replying.
:)
Was This Post Helpful? 0
  • +
  • -

#9 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9048
  • View blog
  • Posts: 33,970
  • Joined: 12-June 08

Re: Visual basics2010 coding- How do I make my button when clicked...

Posted 17 January 2013 - 01:46 PM

No.. you are mistaken. What I am saying is I would be able to help you more effectively if you explained, in a clear and coherent manner, what you are doing.

You whine that no one is helping - well no kidding. Nothing really is making sense from your court. Clarity intices people into helping else they move down the forum to find someone else who at at least that.
Was This Post Helpful? 0
  • +
  • -

#10 ontheoldman  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 8
  • Joined: 17-January 13

Re: Visual basics2010 coding- How do I make my button when clicked...

Posted 17 January 2013 - 01:50 PM

Well I made it much more clear on my other post but you removed that so what can I do? Sounds like someone woke up on the wrong side of bed today! No need to be so angry in all your responses :)
Was This Post Helpful? 0
  • +
  • -

#11 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9048
  • View blog
  • Posts: 33,970
  • Joined: 12-June 08

Re: Visual basics2010 coding- How do I make my button when clicked...

Posted 17 January 2013 - 01:52 PM

I am unclear where you think anger is at in my posts. Try not to confuse bluntness with anger. I am simply explaining where you went off the tracks and how to be a better poster.

Yes I closed the other post - it was a duplicate. If you think that information will help people understand what is going on feel free to post it in this thread.
Was This Post Helpful? 1
  • +
  • -

#12 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10439
  • View blog
  • Posts: 38,658
  • Joined: 27-December 08

Re: Visual basics2010 coding- How do I make my button when clicked...

Posted 17 January 2013 - 01:52 PM

The only thing you really seem to want to do is beg and argue. If you won't help our members help you, then there is no point in keeping this thread open. Topic closed.
Was This Post Helpful? 0
  • +
  • -

#13 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9048
  • View blog
  • Posts: 33,970
  • Joined: 12-June 08

Re: Visual basics2010 coding- How do I make my button when clicked...

Posted 17 January 2013 - 01:58 PM

After the lock - if you have questions on the lock you can PM either me or macosxnerd101.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1