Click here to Skip to main content
15,918,742 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Clean closing Pin
Kevnar11-Sep-07 1:03
Kevnar11-Sep-07 1:03 
Questionmajor project in visual basic Pin
vishal dhir9-Sep-07 19:39
vishal dhir9-Sep-07 19:39 
AnswerRe: major project in visual basic Pin
The ANZAC9-Sep-07 22:03
The ANZAC9-Sep-07 22:03 
AnswerRe: major project in visual basic Pin
Dave Kreskowiak10-Sep-07 1:58
mveDave Kreskowiak10-Sep-07 1:58 
QuestionHow to recover delete files from Hard Disk Pin
Software_Guy_1239-Sep-07 18:50
Software_Guy_1239-Sep-07 18:50 
AnswerRe: How to recover delete files from Hard Disk Pin
Dave Kreskowiak10-Sep-07 1:54
mveDave Kreskowiak10-Sep-07 1:54 
GeneralRe: How to recover delete files from Hard Disk Pin
Software_Guy_12310-Sep-07 18:35
Software_Guy_12310-Sep-07 18:35 
QuestionScope of a variable Pin
ASPnoob9-Sep-07 17:53
ASPnoob9-Sep-07 17:53 
Hi, I have written a simple program to better understand the concept of variable scope and I'd like your help in explaining a few things. My program simulates a ticketmaster, using a bunch of buttons to represent the number of available seats to a show. Every time a customer clicks on a button, its color turns from gray to blue. One seat will be subtracted from the total number of available seats when each button is clicked. I have created a global integer variable TotalSeats which represents the total number of seats available. The following code snippets are for the button which represents the first seat, and for the SHOW button to show the total number of available seats.
   <br />
Dim TotalCount As Integer = 30<br />
<br />
    Private Sub Seat1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Seat1.Click<br />
        Dim A As Integer = 0<br />
        While A < 1<br />
            Seat1.BackColor = System.Drawing.Color.Blue<br />
            A += 1<br />
            TotalCount -= 1<br />
<br />
        End While<br />
    End Sub<br />
<br />
 Private Sub SHOW_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SHOW.Click<br />
       <br />
        Label1.Text = TotalCount<br />
    End Sub

Please answer the following 2 questions, thank you in advance for your help.
1) I thought that TotalCount is a global variable and even though its being used in a private Sub, its should still be visible to the SHOW button, why does Label1 show that TotalCount is 30 and not 29?

2)  How do I group all the seat buttons together so that I can use just one requiredvalidator for all of them?

AnswerRe: Scope of a variable Pin
Mark Churchill9-Sep-07 18:39
Mark Churchill9-Sep-07 18:39 
AnswerRe: Scope of a variable Pin
Chetan Patel10-Sep-07 0:35
Chetan Patel10-Sep-07 0:35 
QuestionWebBrowser Control Woes Pin
jonnyleroux9-Sep-07 12:03
jonnyleroux9-Sep-07 12:03 
AnswerRe: WebBrowser Control Woes Pin
Mark Churchill9-Sep-07 18:34
Mark Churchill9-Sep-07 18:34 
GeneralRe: WebBrowser Control Woes Pin
jonnyleroux9-Sep-07 21:59
jonnyleroux9-Sep-07 21:59 
QuestionException at address Pin
VFaul9-Sep-07 9:40
VFaul9-Sep-07 9:40 
AnswerRe: Exception at address Pin
Christian Graus9-Sep-07 9:42
protectorChristian Graus9-Sep-07 9:42 
GeneralRe: Exception at address Pin
VFaul9-Sep-07 9:53
VFaul9-Sep-07 9:53 
GeneralRe: Exception at address Pin
Luc Pattyn9-Sep-07 10:22
sitebuilderLuc Pattyn9-Sep-07 10:22 
GeneralRe: Exception at address Pin
VFaul9-Sep-07 10:41
VFaul9-Sep-07 10:41 
GeneralRe: Exception at address Pin
Luc Pattyn9-Sep-07 11:29
sitebuilderLuc Pattyn9-Sep-07 11:29 
Questionfind row index where Column = value Pin
cstrader2329-Sep-07 8:06
cstrader2329-Sep-07 8:06 
AnswerRe: find row index where Column = value Pin
Naji El Kotob9-Sep-07 11:42
Naji El Kotob9-Sep-07 11:42 
QuestionColored Circle around cursor Pin
Dave@VB9-Sep-07 6:21
Dave@VB9-Sep-07 6:21 
AnswerRe: Colored Circle around cursor Pin
Christian Graus9-Sep-07 6:33
protectorChristian Graus9-Sep-07 6:33 
Questiondetecting a disconnected wireless connection Pin
steve_rm9-Sep-07 5:59
steve_rm9-Sep-07 5:59 
Questionvb code for closing a running exe application Pin
Nasim Ahamed9-Sep-07 5:59
Nasim Ahamed9-Sep-07 5:59 

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.