1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

VB .NET - Any label pressed

Discussion in 'Software Development' started by Fatnickc, Apr 11, 2007.

Thread Status:
Not open for further replies.
  1. Fatnickc

    Fatnickc Thread Starter

    Joined:
    Aug 12, 2004
    Messages:
    56
    Hi there,
    I'm in the process of creating a fairly simple number game in VB .NET, using a simple form with labels etc., to act as a prototype for the full thing.
    As control arrays are no longer supported, and I wanted something to that effect, after having put 10 labels on the form I used:
    Code:
    Public Cells As New System.Collections.Generic.List(Of Label)
    'And then, later on, populated Cells with:
            Cells.Add(Label1)
            Cells.Add(Label2)
            Cells.Add(Label3)
                     ...
            Cells.Add(Label10)
    Now, I would like to create a function that will be called whenever any of the labels is pressed and will then wait for a keypress indicating a value, to be entered into the pressed cell, or a click on another label.
    However, I am a little stuck as for how to do this, so any help would be much appreciated.
    Thanks,
    fatnickc.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/560572

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice