VS 2008 Trivia Game - Can't Just Put "MsgBox("Correct")" Under One Of The Multple Choice Buttons

Oct 7, 2009

User of Virtual Basic, as we really just started programming in my Computer Programming class yesterday. I figured that I could use Visual Basic to make a trivia game of some sort to study for various classes and stuff.

The game is set up in four categories based on topic, which each has 10 questions. I have no problem linking one form to another here. However, each question is multiple-choice. To get to each question, you need to click on a button, which changes the label text and all that. The problem I'm running into here is that I need a way to get a message to pop up saying "correct" or "incorrect" for each question. Being that each question will have a different answer, I can't just put "MsgBox("Correct")" under one of the multple choice buttons. I've Googled this, and I've found something with setting values to each button, which I tried, but I must have done it incorrectly.

View 1 Replies


ADVERTISEMENT

Writting A Trivia Game For A School Project?

Mar 25, 2011

I need help writting a Trivia Game for a school project. The teacher wanted us to get used to looking to forums and google for help so he refuses to help us for this particular summative.

What I want to know is.. how to use a streamreader to read questions randomly from a text document located in the debug folder (I have 10 questions all in 1 text file in the debug folder, and the same for all of my answers) how to use a streamreader and split function to read answers from a text document located in the debug folder to a combobox.

[Code]...

View 19 Replies

VS 2008 How To Determine Value For Msgbox Buttons

Oct 16, 2009

I know this is just a simple question but I could hardly find the value for the buttons in msgbox for code execution.I tried to use codes I did in vb6 and was able to execute the codes properly but when I started vb2008 I encountered logical error for these codes.Let me take you alook for the codes:[code]When you click the yesbutton it executes the Statement1 but if you click the nobutton it should only execute Statement2.

1.Why is it when you click the nobutton it would still execute the Statement1 instead of Statement2?

2.What would be the right If..Then...Else statement should be used to execute it properly?

View 4 Replies

VS 2008 4 Drop Down Lists, Select A Choice In One, All Get Same Choice?

Mar 12, 2010

I have four drop down lists here and I've assigned the datasource and displaymemberproperties so they are populated by a table. When I run the program and select a choice, all four of them get updated with the new choice.

View 3 Replies

Custom User Controls - Correct Size With User Choice

Sep 27, 2011

I have some custom user controls in my .net winforms program that do not display correctly when the user has selected larger text size. This setting:

My controls look like this:
Instead of like this:

The bill to area and ship to area are both custom controls. I don't know if this is contributing to the problem but I do have code in each to scale the phone/fax areas to stretch nicely, like this code from the bill to control,

Private Sub panFaxPhone_Resize(sender As Object, e As System.EventArgs) Handles panFaxPhone.Resize
panFax.Width = (panFaxPhone.Width / 2) - 1
panPhone.Width = (panFaxPhone.Width / 2) - 1
panFax.Left = panFaxPhone.Width - panFax.Width
End Sub

How can I get my controls to size correctly while still respecting the users choice for larger text (I don't want to just set the AutoScaleMode to None)? After playing with this for a long time it seems to be a problem with anchors in the child controls. See this below image, the inner black box is the control with its border turned on, the text boxes (like name) are anchored left and right and should stretch to fill the control, but don't.

View 1 Replies

How To Respond To Msgbox YES/No Buttons

Jun 8, 2011

I have a datagrid and I want to delete selected row from that grid. It is working fine upto this. but I want to add some advance functioning with msgbox YES-No buttons. If user select some row and click on delete button, A msgbox with YES/No options appears. If user clicks YES, row should be deleted but if No is clicked then that row should not be deleted.

Below is the code:

view source
print?
Private Sub btnDeleteSitting_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDeleteSitting.Click
MsgBox("Are you sure to DELETE?", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, "WARNING")

[code]....

View 2 Replies

MsgBox With Ignore & OK Buttons?

Mar 2, 2010

I'm using VB .NET 2005 Express (all the latest...5 years ago). Is there some easy way to bring up a MsgBox which has only "Ignore" and "OK" buttons, or would I have to create my own form?

View 15 Replies

Radio Buttons On A MsgBox?

Dec 27, 2010

I have a Windows Forms application.I need some type of pop-up windows that will give the user a way to select one of several options.

View 1 Replies

Game Programming :: How To Make Question Box (msgbox)

Jul 8, 2010

I am making a game in vb.net and was wondering how to make question box eg. if a person clicks on a button he gets a message boxs which asks him a question he has to answer. the msgbox should have a text box or something for input and if their answer is the same as the one i have specfied then the message box says correct. if not then says it is wrong.

View 6 Replies

Game Getting Random Strings - No Correct Results

Jun 22, 2010

When I use my own word e.g. here "jose" the results are correct but when I use random string it doesnt work the same.

Here's my code
Imports System.Text
Public Class Form2
Dim guess As String = " "
Dim bulls As Integer = 0
Dim cows As Integer = 0
[Code] .....

View 1 Replies

Game Programming :: Alogrithm - Attempting To Get High Scores Into The Correct Order

Sep 16, 2009

I am attempting to get hiscores into the correct order but.. I am having troble with some of it.. I have this for my sort alogrithm

Code:

For i = 0 To Howmany
For j = i + 1 To 9
If ArrScore(i) < ArrScore(j) Then
temp = ArrScore(i)

[CODE]...

The hiscores text file looks like this:

Code:

Stuart:120,LoL:192,Computer:112,LoL:113,

The immediate window looks like this when its run.

Code:
0 1 , Stuart , 120
0 2 , LoL , 192
1 2 , 120 , 120
2 3 , Computer , 112
2 4 , LoL , 113
3 4 , 112 , 112

View 3 Replies

Black Jack Game - Display Value In Textboxes When Buttons Pressed

Apr 3, 2011

I am having trouble with a blackjack game I am creating
I have buttons 1 - 13 (A-K)
I have 5 Textboxes which when the above buttons are pressed displays the values in the textboxes.
I also have one more textbox which adds up the values of the above 5 textboxes to give your Black Jack Total.

The problem I have is if an Ace (11) is in one of the textboxes and the Total Value exceeds 21 I need to have the Ace (11) change its value to 1 instead.
textbox 1 - 5 will be the card values
textbox6.text will be the total Value

I have tried......
if textbox6.text > 21 and textbox1.text = 11 then textbox1.text = 1

This seems to work fine however it only solves the problem of an Ace (11) appearing in textbox1.text so i tried to repeat the code with the other boxes...
if textbox6.text > 21 and textbox1.text = 11 then textbox1.text = 1
if textbox6.text > 21 and textbox2.text = 11 then textbox2.text = 1
if textbox6.text > 21 and textbox3.text = 11 then textbox3.text = 1
if textbox6.text > 21 and textbox4.text = 11 then textbox4.text = 1
if textbox6.text > 21 and textbox5.text = 11 then textbox5.text = 1
However this does not work and my program freezes?

View 11 Replies

Quiz Game - Late Binding - Created Five Buttons In My Vb Application And One Table In Sql As Under

Apr 2, 2012

I want to make a simple quiz game like kbc in vb.net 2008, for that i have created five buttons in my vb application. and one table in sql as under

create table kbc
(
Question varchar(100),
Option1 varchar(100),
Option2 varchar(100),
Option3 varchar(100),
Option4 varchar(100),
Answer varchar(100)
)

And i have inserted these records in this table like this

insert kbc values('Largest key of ur pc is ','Enter','Backspace','Shift','Space','Space')
insert kbc values(2,'How many muscles are there in a human body ?','206','602','605','208','605')

Now back to my vb form the first button will catch the question and second,third,fourth,fifth buttons will catch options from sql database that i have shown. just as kbc i want to show one question with its four options. and when user click on any button i also want to check the right answer. right answer is also in my kbc table's Answer column. to do that i have written this code

Imports System.Data.OleDb
Imports System.Data
Imports System.Threading
Imports System.Data.SqlClient

[CODE]...

On all button's click i have declared temp variable to catch the last column's text from my sql table and then i want to match this text with the text of that button the user clicked. if texts match i want to go to the next question of my quiz program. how to do that working. but it is not working as i want.

View 2 Replies

VS 2008 Disable Text Boxes Until Combo Box Choice Is Made?

May 28, 2009

I currently have my cute little first program made... I'm just stepping into the water with this programming thing. I made a program where you can select a shape from a drop-down list and then input some values and click a button and get the area of the shape. I have it working so that when a certain shape is chosen, certain fields are disabled, such as when you pick "circle" from the combo box, the "length", "width", and "number of sides" text boxes are disabled but the "radius" text box is enabled, thus allowing you to enter the radius and find the area. I want to make it so that when you first load the program, all of the text boxes for the length, width, number of sides and radius are disabled until you select a shape from the list. Currently I'm using

[Code]...

This works for disabling the correct boxes when something is selected, but I don't know if I'm even on the right path with that first part.

View 7 Replies

Msgbox Capabilities - Msgbox Cleared Without Having The User Do It Manually?

Nov 15, 2011

if its possible to have a msgbox cleared without having the user do it manually? what would be my best option here?

View 8 Replies

Turn On The Single Instance Application Choice In Visual Studio 2008 Properties?

Dec 22, 2010

I wish to turn on the Single Instance Application choice in Visual Studio 2008 properties. To do so, I must choose "Enable Application Framework". When I do that, my ONLY choice is to choose a Startup Form, not a Startup object. This makes no sense to me. I have a tray application, and I check to see which form I should load, a logon form, or the main form. But since I am forced to choose a startup form, I MUST load the logon or main form to begin with. But I don't want to. I want startup code to determine which one to load first. So then I am playing with making the OTHER form invisible, even if the startup form, but that is a mess.

View 4 Replies

VB 2008, Get Some Buttons To Interact With Other Buttons On Screen ?

Sep 15, 2009

i need to get some buttons to interact with other buttons on screen when i click then, as each indivual button gives a slightly different result.imagine this:[code]....

then i need then to hide different buttons depending on which button was pressed. so say i pressed button 1 then all the buttons showed but alternativly if i had of pressed 2 then say button 5 and 6 disapear.managed to get one way to work but then i would only ever end up with the first results every time.

View 2 Replies

Resolution And Buttons - Tabs, Inside Each Tab There Are Buttons (the User Can Add The Buttons When They Want)

Mar 3, 2012

I have a piece of software with two tabs, inside each tab there are buttons (the user can add the buttons when they want). when tab1 is full tab2 should start to fill. I currently know how many buttons fit on the screen so I just say something like if buttons > 150 then start to populate tab 2 The problem i have now though is if the resolution is changed then a different amount of buttons can be displayed. so if I put my screen to 1280x720 some buttons are left of. I was thinking of detecting the resolution and then using different cases for different resolutions but this seems very inefficient im wondering if there is a different way?

View 5 Replies

VS 2008 "Pacman" Ghosts Random Direction Choice?

Nov 20, 2009

I've got a small pacman-like game where ghosts are running around a maze. At the moment, their movement is completely random. Each step, they determine which directions they can possibly move in (taking into account walls), and then they choose, randomly, one of those directions.Now, this works, but it's not very good. If a ghost is in a long corridor where he can only move up or down (or left/right), then he will usually not go anywhere, but just move up, down, up, down, down, up, up, down, up, etc. So, while it does move every step, in the long run it doesn't go anywhere.

View 7 Replies

VS 2008 If Press F1 A Msgbox Will Pop Up?

Jun 20, 2009

how can i make it so if i press f1 a msgbox will pop up?

View 7 Replies

VS 2008 Msgbox When Type Hello?

May 30, 2009

Something like this

VB.NET
If GetAsyncKeyState(System.Windows.Forms.Keys.H And e.KeyCode = Keys.E) Then
MsgBox("hello")

[code].....

View 5 Replies

VS 2008 Using MsgBox With If Functions?

Oct 10, 2009

I am trying to learn how to use message boxes. I am just starting out but really enjoy it. My basic structure is to have seven yes/no questions that change a variable(x) by adding + 1 to everytime you get the question right. My question lies within the message box and getting my variable to change with every question (or not if wrong button is pushed). Heres what I have coded so far...

HTML

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClick.Click
Dim x As Integer
Car(x)

[code]....

I have been getting no output and when i debug All values of x are 0. I only have one return and it is at the very end of the Car Function (Return x).

View 6 Replies

VS 2008 - Display Array Like MsgBox

Mar 4, 2010

I have an array I know is getting initial values. I need to be able to see it's results visually like a msgbox. That will be the official output.

Sub SaveDestFile()
Dim StaffCode As String
Dim MyRec As String
Dim Duration As String
Dim FlagMe As String
[Code] ....

View 7 Replies

VS 2008 - How To Get Time Into MsgBox With RegEx

Dec 15, 2009

I have a text form with some text in it (html). I need to get the time into a msgbox (red).
"><span id="ctl00_cphMain_ucShowAuction1_lblTimeLeft">00:49</span></span></span></div>
How can you do that with regex ?

View 12 Replies

VS 2008 : Get A Msgbox With Some Text And A Yes And No Option?

May 11, 2009

I want a msgbox with some text, and a Yes and No option..Why wont this code work?

MsgBoxStyle.YesNo ("TEXT")

View 10 Replies

VS 2008 - Button Function To Display MsgBox

Nov 11, 2011

So I want when you click Button1, it displays MsgBox ("Hello"), when you click again, it displays Msgbox("World"). Then it all starts Hello "world hello world" etc.

View 5 Replies

VS 2008 - How To Check Multiple Text In MsgBox

May 24, 2009

I am using this code right now
If i.Contains("1") Then
MsgBox("2")
Else
End If

But what I want to do it have it check multiple text like this
If i.Contains("1") or ("2") or ("3")Then
MsgBox("H2")
Else
End If
But that doesn't work?

View 3 Replies

VS 2008 MsgBox When Process Isnt Found?

Sep 4, 2009

How would I change the following code so that if the process isnt found, it will pop up a msgbox

[code]...

View 3 Replies

VS 2008 Msgbox On Webpage Load In Webbrowser Control

Sep 7, 2009

How would I make it so that a messagebox loads after a page loads in a webbrowser control? Let's just make it WebBrowser1.

View 2 Replies

VS 2008 Random Number Generator - Show In Msgbox

Dec 4, 2011

i follow this script Quote:

[Code]...

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved