Click here to Skip to main content
15,910,009 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Restrict the user from entering strings in a DatGridView column.. Pin
nishkarsh_k29-Dec-07 17:06
nishkarsh_k29-Dec-07 17:06 
GeneralRe: Restrict the user from entering strings in a DatGridView column.. Pin
Paul Conrad30-Dec-07 10:38
professionalPaul Conrad30-Dec-07 10:38 
Questionhow can learn (as an absolute beginner) Windows Workflow Foundation? Pin
Shimmy Weitzhandler29-Dec-07 8:14
Shimmy Weitzhandler29-Dec-07 8:14 
AnswerRe: how can learn (as an absolute beginner) Windows Workflow Foundation? Pin
John_Adams30-Dec-07 20:09
John_Adams30-Dec-07 20:09 
QuestionHoe to add text(Serial number) in fixed col of every row of dataviewgrid Pin
nishkarsh_k29-Dec-07 7:53
nishkarsh_k29-Dec-07 7:53 
GeneralRe: Hoe to add text(Serial number) in fixed col of every row of dataviewgrid Pin
Shimmy Weitzhandler29-Dec-07 8:17
Shimmy Weitzhandler29-Dec-07 8:17 
GeneralRe: Hoe to add text(Serial number) in fixed col of every row of dataviewgrid Pin
nishkarsh_k29-Dec-07 9:11
nishkarsh_k29-Dec-07 9:11 
AnswerRe: Hoe to add text(Serial number) in fixed col of every row of dataviewgrid Pin
Shimmy Weitzhandler29-Dec-07 14:17
Shimmy Weitzhandler29-Dec-07 14:17 
QuestionHow to disable unnecessary items in propertygrid Pin
VB 8.029-Dec-07 3:58
VB 8.029-Dec-07 3:58 
AnswerRe: How to disable unnecessary items in propertygrid Pin
Scott Dorman29-Dec-07 4:03
professionalScott Dorman29-Dec-07 4:03 
GeneralRe: How to disable unnecessary items in propertygrid Pin
VB 8.031-Dec-07 2:05
VB 8.031-Dec-07 2:05 
QuestionFind unused functions Pin
nishkarsh_k29-Dec-07 2:01
nishkarsh_k29-Dec-07 2:01 
GeneralRe: Find unused functions Pin
Scott Dorman29-Dec-07 4:05
professionalScott Dorman29-Dec-07 4:05 
GeneralGive info regarding Graphics Pin
VB 8.029-Dec-07 1:25
VB 8.029-Dec-07 1:25 
GeneralRe: Give info regarding Graphics Pin
Dave Kreskowiak31-Dec-07 4:15
mveDave Kreskowiak31-Dec-07 4:15 
Generalhelp to use outlook express in coding Pin
Senthil S29-Dec-07 0:36
Senthil S29-Dec-07 0:36 
GeneralRe: help to use outlook express in coding Pin
Dave Kreskowiak29-Dec-07 6:43
mveDave Kreskowiak29-Dec-07 6:43 
GeneralRe: help to use outlook express in coding Pin
Paul Conrad29-Dec-07 6:53
professionalPaul Conrad29-Dec-07 6:53 
QuestionDisabling keyboard access in dataGridView? Pin
Benny_Lava28-Dec-07 22:39
Benny_Lava28-Dec-07 22:39 
GeneralSecurity levels/user access control in windows form application Pin
tellytub28-Dec-07 18:19
tellytub28-Dec-07 18:19 
GeneralRich Text Box query: embedding SQL record id's in text Pin
Ned Rifle28-Dec-07 17:06
Ned Rifle28-Dec-07 17:06 
General911 Emergency - Lost in the sauce Pin
Dee Kay28-Dec-07 16:34
Dee Kay28-Dec-07 16:34 
I am a middle aged internet college student trying to get some assistance a Case problem for my course. I have ask for help from instructor, but due to the holidays he has not replied to any of my queries. My assignment is due no later midnight on the 28 of Dec 07. I am stuck like chuck...

Project Name: Random Number Game
Scope: Create an VB.Net app that allows the user to guess a random number generated by the computer. When the user makes an incorrect guess, the application should move an image up or down depending on how the guess compares to the random number. If the random number is greater that users guess the image shoould move upwards to indicate to the user to guess higher. Same with a lesser guess but the image moves lower indcate the user shoul guess lower. The game ends when the user guesss the random number. If the usershould opt to end the game early the random number should be displayed.

I have been able to create a text indicator version of this game without the early termination criteria. I have come to an impass. Snippet of code of functioning code below:

---------------------------------------
Option Strict On
Option Explicit On

Imports System.Globalization

Public Class mainForm

Private Sub startButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles startButton.Click

Dim randomGenerator As New Random
Dim inputString As String
Dim input As Integer
Dim random As Integer
Dim isConverted As Boolean
Const Prompt As String = "Enter guess"
Const Title As String = "Guess a number"
'Dim cancel As DialogResult = Windows.Forms.DialogResult.Cancel ' Case usage
'Dim ok As DialogResult = Windows.Forms.DialogResult.OK ' Case usage
'Dim choice As DialogResult

' primer read - not needed program work fine without it
'input = 0

'generate random number from 1 t0 10
random = randomGenerator.Next(1, 11)

' Begin Loop
Do

'input guess
inputString = InputBox(Prompt, Title, "0")

'Select Case choice
' Case Windows.Forms.DialogResult.Cancel
'If Windows.Forms.DialogResult.Cancel = cancel Then
'input = random
'MessageBox.Show("The number was " & random, "Answer", MessageBoxButtons.OK)

'End If
' Case Windows.Forms.DialogResult.OK
'If Windows.Forms.DialogResult.OK = ok Then
isConverted = Integer.TryParse(inputString, input)
If isConverted = True Then

'if input is integer then execute loop
If input > random Then
displayLabel.Text = "Guess lower"
ElseIf input < random Then
displayLabel.Text = "Guess Higher"
Else : input = random
displayLabel.Text = random & " is correct"
End If
Else

MessageBox.Show("Enter a number between 1 and 10")
End If
'End If
'End Select



'End Select
Loop Until input = random ' End Loop
'-----------------------------------------------------------

'display correct guess
'If input = random Then
'MessageBox.Show("You are correct") 'alternate method of correct guess display
'displayLabel.Text = random & " is correct"
'End If

End Sub
End Class

You will notice that I remarked out my all my Case structure, when I add them the program ceases to function properly. Any help would be appreciated, I have waited to the last minute because I thought I woulde get the help I needed from my instructor. Thanks in advance to any who care to respond. Frown | :(
GeneralRe: 911 Emergency - Lost in the sauce Pin
MikeMarq28-Dec-07 21:34
MikeMarq28-Dec-07 21:34 
GeneralRe: 911 Emergency - Lost in the sauce Pin
Dee Kay29-Dec-07 2:22
Dee Kay29-Dec-07 2:22 
GeneralRe: 911 Emergency - Lost in the sauce Pin
MikeMarq29-Dec-07 7:07
MikeMarq29-Dec-07 7:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.