| | |
vb dot net help
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2008
Posts: 14
Reputation:
Solved Threads: 0
i am using vb dot net. i want to store multiple values in a variable and then check whether any of the values held in the variable match what the user inputs. Please help i can not code it , i tried but failed.
This is not homework just a practice task so that i am able to code in vb dot net
could you please elaborate on answers as i do not how i would use arrays in this way thanks
i couldn't do it with arrays so tried with if statements and variable si know it doesn't work but just did it, to show you guys that i tried .
here is my code:
[ code] If voter number = voternumcheck Then
MsgBox("Please choose how you will like your voting to take place by clicking the appropriate button")
btnvotes.Enabled = True
btnpercentage.Enabled = True
Else code]
Thanks
This is not homework just a practice task so that i am able to code in vb dot net
could you please elaborate on answers as i do not how i would use arrays in this way thanks
i couldn't do it with arrays so tried with if statements and variable si know it doesn't work but just did it, to show you guys that i tried .
here is my code:
[ code] If voter number = voternumcheck Then
MsgBox("Please choose how you will like your voting to take place by clicking the appropriate button")
btnvotes.Enabled = True
btnpercentage.Enabled = True
Else code]
Thanks
Go to google.com search on "array in VB.NET"
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Here's a sample how to work with arrays
Suggested reading: Array Class in MSDN
VB.NET Syntax (Toggle Plain Text)
Private VoteArray() As Integer ' Array for items (integers in this case) Private Const VOTE_ARRY_SIZE As Integer = 3 ' Number of items in the array ' A help variable to hold "voted number" Private Voted As Integer Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ' ' Set array size. Notice: arrays are zero-based ReDim VoteArray(VOTE_ARRY_SIZE - 1) ' If you have continuous values, use a loop to fill the array VoteArray(0) = 2 VoteArray(1) = 3 VoteArray(2) = 4 End Sub Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click ' ' Notice: Voted value is now hard coded, you'll use textbox or something like that Voted = 2 If [Array].IndexOf(VoteArray, Voted) >= 0 Then MessageBox.Show("Found", "Vote", MessageBoxButtons.OK, MessageBoxIcon.Information) Else MessageBox.Show("Not found", "Vote", MessageBoxButtons.OK, MessageBoxIcon.Information) End If End Sub
Teme64 @ Windows Developer Blog
![]() |
Similar Threads
- Dot Net job available for a programmer/teacher (Software Development Job Offers)
- Dot Net programmer wanted. Work from home. (Web Development Job Offers)
- Problem opening / creating Dot net 2003 projects (Windows Servers and IIS)
- green-dot.net.ms (Website Reviews)
- dot net supports for mac amchines (C#)
Other Threads in the VB.NET Forum
- Previous Thread: Adding Notepad in VS2005
- Next Thread: Problem with ComboBox DataGridView Column
| Thread Tools | Search this Thread |
.net .net2008 30minutes 2005 2008 access account arithmetic array basic bing button buttons center check code combobox component connectionstring crystalreport data database databasesearch datagrid datagridview date design dissertation dissertations dropdownlist excel fade file-dialog filter folder ftp generatetags google gridview hardcopy images input insert intel internet mobile monitor ms net networking objects output panel passingparameters peertopeervideostreaming picturebox picturebox1 port position print printing problem problemwithinstallation project save searchbox searchvb.net select serial shutdown soap survey table tcp temperature text textbox timer timespan toolbox trim update updown user vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf year






