Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 04-23-2005, 04:04 PM   #1
In Runtime
 
Join Date: Mar 2005
Posts: 194
Default "Controll Arrays" in Visual Basic

Is there any way in visual basic that I can easily manipulate controlls?

Basicly I want it so when a button is pressed, other buttons change depending.

So I could have it so if one button is pressed and say a value was three I could say Button3 diabled?

Sorry if this makes no sense, im a newbie in VB. I can see how this could be done in an array, but not how to do it to an object.
__________________

__________________
AMD Athlon 64 3500+ Venice (skt938), ABit AN8-SLI Mobo, nVidia GeForce 6600 GT, 1Gb Crucial PC3200 DDR Memory, 160Gb Hitachi 7K250, NEC 16x DL DVD/RW, Coolermaster Centuron Case, Tegan PSU,
Post Count +1, IQ -1.
Delta is offline   Reply With Quote
Old 04-23-2005, 04:15 PM   #2
In Runtime
 
Join Date: Mar 2005
Posts: 194
Default

I've thought of a diffrent (prebbery better in my case) way of doing what im trying to do, but im still interested in any comments
__________________

__________________
AMD Athlon 64 3500+ Venice (skt938), ABit AN8-SLI Mobo, nVidia GeForce 6600 GT, 1Gb Crucial PC3200 DDR Memory, 160Gb Hitachi 7K250, NEC 16x DL DVD/RW, Coolermaster Centuron Case, Tegan PSU,
Post Count +1, IQ -1.
Delta is offline   Reply With Quote
Old 04-24-2005, 12:50 AM   #3
In Runtime
 
Windwaker222's Avatar
 
Join Date: Nov 2004
Posts: 351
Default Re: "Controll Arrays" in Visual Basic

this should be easy enough but please explain more in depth or what you are trying to do..
__________________
AMD Phenom 9600 / 4GB OCZ Gold / nVidia 8800GT / ASUS Crosshair 4xPCI-E
Windwaker222 is offline   Reply With Quote
Old 04-24-2005, 06:15 AM   #4
In Runtime
 
Join Date: Mar 2005
Posts: 194
Default Re: "Controll Arrays" in Visual Basic

Yeah sorry, it was late

I have a series of buttons, when I press one, based on a number value in a text box I want to disable another button,

so say I have a value of 2 in the box, and I press a button, I want the button thats 2 higher than the current to be disabled. Rather like if it was an array I was manipulating

(this is C++ because I know it better )

array[current+2]

If you get my meaning, rather than an array its a series of buttons I want to select,

Hope this makes sense :S

EDIT: One way I could do it is to have an array to manipulate and then update the status of all the buttons when one is clicked, but surely there is a more streamlined way to do this.
__________________
AMD Athlon 64 3500+ Venice (skt938), ABit AN8-SLI Mobo, nVidia GeForce 6600 GT, 1Gb Crucial PC3200 DDR Memory, 160Gb Hitachi 7K250, NEC 16x DL DVD/RW, Coolermaster Centuron Case, Tegan PSU,
Post Count +1, IQ -1.
Delta is offline   Reply With Quote
Old 05-01-2005, 01:35 PM   #5
In Runtime
 
Windwaker222's Avatar
 
Join Date: Nov 2004
Posts: 351
Default Re: "Controll Arrays" in Visual Basic

This was done with a text box, submit button, and 12 other buttons

Private Sub cmdSubmit_Click()

Dim Num As Integer

Num = txtNum.Text

'Since the control array starts at 1 do -1 unless you ' want to start your buttons at 0
cmdBTN(Num - 1).Enabled = False

End Sub
__________________
AMD Phenom 9600 / 4GB OCZ Gold / nVidia 8800GT / ASUS Crosshair 4xPCI-E
Windwaker222 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 09:47 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0