Visual Basic 6 - Control Array

  Gaz W 15:13 29 Apr 04
Locked

I have to create a program which in VB6 will basically be a security keypad.

Buttons (in a control array) for the numbers 0-9, a Clear button and an Enter button.

Text box at the top that shows the numbers in asterisks as they are entered, and another text box at the bottom.

When an incorrect code is entered, Access Denied appears in the text box at the bottom. When a correct code is entered, the name of a person appears in the bottom text box, and a picture and another text box appear to the right, with various details.

This (to me at least) is a very difficult thing to do and I would appreciate it if anyone could provide me with any links/information on how I'd go about this.

Basically I've got the layout of the form with the control array; the buttons 0-9 are called Number (creatively). What I can't do is get the numbers to come up in the top thing after each other, never mind in ***'s, and then it's how to make it load the image & text boxes up dynamically.

Sorry if this posting is a bit long and scattered but I've been trying for ages to work all of this out and I'm thinking different things I've done or could do all the time - none work though!

Any help would be much appreciated,

Gaz

  scooby43 15:17 29 Apr 04

I dont know much about VB my self you could try this though explains about using arrays.

click here

  Gaz W 17:19 29 Apr 04

Thanks for that link scooby43.

I'm going through the page about control arrays (click here) and what I have now is the control array - buttons 0-9.

Now whenever I change the code to read something, it changes for every button. How do I get it to bring up - for now at least the numbers, in the top text box? Or am I missing the point?

  seedie 17:28 29 Apr 04

Is this part of a college/uni course ?


CD

  Gaz W 17:33 29 Apr 04

seedie,

Yes it is part of a course.

Let me make it clear though that basically I'm just trying to get as much information about and help on control arrays as I can to try and work out how to do this, not look for the answer.

Any help would still be appreciated because it's the most difficult thing I've had to do in VB and this is supposed to be simple!!!

  Gaz W 17:43 29 Apr 04

By the way...

I was thinking that one way of doing this would be to use a blank image and a blank text box, but it's supposed to appear dynamically.

  seedie 17:46 29 Apr 04

who may be able to help.

Good luck

  Gaz W 18:06 29 Apr 04

My main problem is changing the code behind the command buttons - if I change the code behind one of them, it changes for all of them? How can I use them to represent the numbers 0 to 9?

  Gaz W 18:37 29 Apr 04

Right, I've now managed to get it doing something at least. I've got my control array of buttons with the code in it:

Select Case Index
Case 0
Text1.Text = ("1")
Case 1
Text1.Text = ("2")
Case 2
Text1.Text = ("3")
Case 3
Text1.Text = ("4")
Case 4
Text1.Text = ("5")
Case 5
Text1.Text = ("6")
Case 6
Text1.Text = ("7")
Case 7
Text1.Text = ("8")
Case 8
Text1.Text = ("9")
Case 9
Text1.Text = ("0")
End Select

Now this only changes the Text1.Text to the last number pressed, and doesn't bring up *'s, although that can be sorted out I think more easily (I think).

  scooby43 13:56 30 Apr 04

hm you could use a while loop ill have to get back into programming :)

  Gaz W 14:22 30 Apr 04

Thanks everyone - got it sorted now.

It is to do with the indexes being different.

Thanks anyway for your help,

Gaz

This thread is now locked and can not be replied to.

iPhone 7 review: a range of small updates add up to an excellent phone

1995-2015: How technology has changed the world in 20 years

How New York’s Stylin’ Seniors became a golden social media campaign

23 Apple Watch tips & secret features: Master your Apple Watch, Apple Watch Series 1 or Apple…