473,783 Members | 2,286 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help needed with my program

Hi
I am taking intermediate level VB.Net class. Currently, we are doing
the second review project which is quite big. It is a voting system
where we display the participants for Candiadets and measures by
reading from a flat file and after the user finsihes voting, we allow
the user to cast the vote by clicking a button which will display a
message saying that the vote had been counted for 2 sendonds before
program closing. The button click event for casting vote should update
the vote counts in the arrays and then writit to the flt file.

Btw, the instuctor is not helpful at all + I am not talking this class
for a grade. I am register as Credit/No Credit. Anyway, we have a form
with Previous Screen button, Next screen button, and Cancel and start
over button + 4 panels:

- Candidate panels with Title label that indicate position such as
President and then on te second line, teh vote number alllowed +
participants info displayed in labels alongside the blank labels where
user can click to enter X. We are supposed to allow user to click on
either labels to vote. When maximum vote is reached, user cannot click
on another label on that page unless first removed the vote selected.
Also, if maximum vote allowed is 1, if the user select to vote after
already seclecting avote, the program should slect the latest vote on
that page and clear the rest. Note that user can go to previous screen,
except on the first page, and change the vote.

- Measure panels with title as in Candidate + Yes and No labels with a
label that describes the measure. here, user can choose to vote Yes or
No and we have to count both. Note that user can go to previous screen,
and change the vote. On the last page, the Next Screen button will take
to the panel that displays the button to cast the vote which will
update the vote count and write to flat file.

- Cast Vote pabel that has one button that allows to cast vote

- Vote Counted panel that displays teh message that the vote has been
counted

I have finished loading the form with data from the arryas that were
loaded with data from flat file using substring function. My form can
display all pages correctctly with button "Previous Screen" and button
"Next Screen" working properly as far as taking the user to previous an
dnext pages. So far, the "cast vote" button on 3rd panel has no code
except bringing up the 4th panel as it should.

Currently, I am working on allowing the user to enter vote. I am trying
to display X when the user enters vote for candidate pages. As I said,
the instructor is not helpful at all - he is more concern about us
following his format so that he can grade easily. I know that I have to
use sender object to accept the click event of the labels for the
candidates. Can anyone give me some sample code to accomplish this? If
you want to look at the code I have for this, here it is:

Private Sub lblCandidateX_C lick(ByVal sender As Object, _
ByVal e As System.EventArg s) Handles _
lblCandidateX1. Click, _
lblCandidateX2. Click, _
lblCandidateX3. Click, _
lblCandidateX4. Click, _
lblCandidateDes cription5.Click , _
lblCandidateDes cription6.Click , _
lblCandidateDes cription7.Click , _
lblCandidateDes cription8.Click , _
lblCandidateDes cription1.Click , _
lblCandidateDes cription2.Click , _
lblCandidateDes cription3.Click , _
lblCandidateDes cription4.Click , _
lblCandidateDes cription5.Click , _
lblCandidateDes cription6.Click , _
lblCandidateDes cription7.Click , _
lblCandidateDes cription8.Click
' Handles label click events for all pages in candidate panel but I
am only wokring on the first page of the candiadet panel

' mstrVotesAllowe d is the array that hold data from flat file
' mconVotesAllowe dLength is used in substring to get data
formstrVotesAll owed
' mobjVoteArray is an object array holds the labels control names for
labels for X
'mobjCandidateA rray an object array holds the labels control names for
labels for Candidate info

Dim pintCounter As Integer = 0
For pintCounter = 1 To 8
If (mstrVotesAllow ed(mintCurrentI ndex) = mconVotesAllowe dLength _
And (sender.Name = mobjVoteArray(p intCounter).Nam e) Or _
sender.Name = mobjCandidateAr ray(pintCounter ).Name) Then
mobjVoteArray(p intCounter).Tex t = "X"
mintYesVote(pin tCounter) = 1
Else
mobjVoteArray(p intCounter).Tex t = ""
mintYesVote(pin tCounter) = 0
End If
Next End Sub

Sep 15 '06 #1
0 979

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2975
by: Sims | last post by:
Hi, Given a string $txt and an array of strings $txt_array what would be the best/fastest way to search in _insensitive_ case if $txt is in $text_array and, if it is, where is it? Because I want to use the array with an ID Something like,
6
2676
by: Jack Smith | last post by:
Help needed on this question. Any help is appreciated. Thanks in advance. Given a binary string (i.e. a finite sequence of 0's and 1's) we choose any two digit substring 01 and replace it by a string of the form 100...0 using an arbitrary (but finite) number of zeros. Prove by induction that this transformation can not be performed infinitely many times, i.e. this sequence of transformations must terminate for any input string.
1
1982
by: worzel | last post by:
Hi All, I am looking for a reg ex that will match email addresses withing <a href=mailto blah > links. Actually, I already crafted my own, but with a slight problem: <a href="mailto:fred@blah.com"> emal me</a> woud be matched as expected, but so will:
2
1488
by: Willie | last post by:
I try to setup SQL Server to work with .NET Framework Anyone here willing to help? Step By Step Help Needed. Thanks
14
2191
by: tbird2340 | last post by:
I want to write an if / then statement and have tried using this: var MyVarMailto; if (Request.Form("LoanRequest") == "Under $250,000") { if (Request.Form("Organization") == "1") { MyVarMailto = "emailA@address.com"; } } else if (Request.Form("LoanRequest") == "Over $250,000") { if (Request.Form("Organization") == "1") {
1
1739
by: BHPexpert | last post by:
Regular Expression help needed -------------------------------------------------------------------------------- I want to extract all text that is contained inside the brackets after the word INDIRECT. There must be at least one pair of parentheses, they may be multiple pairs for exampple, this string '=IF($B$9="Off",0,INDIRECT(ADDRESS(1(8),COLUMNS($A$41:C41),,,$B$9 )),()aaaa' has four bracket pairings until the initial "(" is...
1
1270
by: Brian Gallagher | last post by:
I have an aspnet application which I only want part of to be avaliable between the hours of 9am and 5:30pm but I dont know where to start. Help needed!
0
2592
by: Christopher | last post by:
Urgent Help Needed: The EPVH-1.1 Visual Hull Library. Dear All, I am a student doing research in computer vision. The EPVH-1.1 Visual Hull Library will really help a lot in my research. I did have this library before but I didn't keep my copy of this library because I always thought I could download it again form internet. However, the author of this library closed the download
1
2619
by: Joel Fireman | last post by:
Help Needed: Upgrade Fedora 4 / Apache 2 to PHP 5.2.x from 5.0.4 I've been testing Joomla as a content manager for the County offices, and it looks pretty good. Unfortunately, I decided to upgrade it from the 1.0.13 version to 1.5 as we get ready to go live with the web site... and the update installation gives an error in XML processing, which seems (from what I've been able to dredge up in forum discussions) to stem from a known bug in...
32
2794
by: =?Utf-8?B?U2l2?= | last post by:
I have a form that I programmatically generate some check boxes and labels on. Later on when I want to draw the form with different data I want to clear the previously created items and then put some new ones on. In my code I am doing the following: For Each ctrl In tpMain.Controls If TypeOf (ctrl) Is CheckBox Then If ctrl.Name.StartsWith("chkS") Then ctrl.Visible = False
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10315
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.