Electronic Ballot Box in Visual Basic 2010

visual basic urna eletronica
visual basic electronic voting machine

Recently, a Visual Basic activity was proposed for the fixation of concepts and the use of basic Visual Basic tools. Here's what was proposed:

Electronic Ballot Box in Visual Basic 2010

Develop an electronic voting machine, using Visual Studio's VB.net, which has three voting options (Sierra, Haddad or Nulo), where the user can vote by clicking the CONFIRM button. This application must count the votes, until the user clicks on the VOTING CLOSED button, when that happens, the votes and the candidate's proper placement must be displayed on the screen.

Example:

  • 1st Serra – 1,300,000 votes
  • 2nd Haddad - 1,250.00 votes
  • 3rd Nulls - 400,000 votes

I developed a Super Basic Voting Machine in Visual Basic 2010 using just some Visual Basic tools combined with some programming lines.

Click here to download the Voting Machine.

Click here to download the complete Voting Machine project in Visual Basic 2010 (Visual Studio).

source code

Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal and As System.EventArgs) Handles Btnserra.Click Txtvotos.Text += 1 MsgBox("You Voted SERRA. Click Ok to Continue.") Btnserra.Enabled = False Btnhadad.Enabled = False Btnnulo.Enabled = False Lblescolha.Enabled = False Btnsecao.Visible = True Btnencerrar.Visible = True End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal and As System.EventArgs) Handles Btnhadad. Txtvotoh.Text += 1 MsgBox("You Voted for HADAD. Click Ok to Continue.") Btnserra.Enabled = False Btnhadad.Enabled = False Btnnulo.Enabled = False Lblescolha.Enabled = False Btnsecao.Visible = True Btnencerrar.Visible = True Btnencerrar. True End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal and As System.EventArgs) Handles Btnnulo.Click Txtvoton.Text += 1 MsgBox("Your vote was NULL. Click Ok to Continue.") Btnserra.Enabled = False Btnhadad.Enabled = False Btnnulo.Enabled = False Lblescolha.Enabled = False Btnsecao .Visible = True Btnencerrar.Visible = True End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal and As System.EventArgs) Handles Btnencerrar.Click Btnserra.Enabled = False Btnhadad.Enabled = False Btnnulo.Enabled = False Btnsair. Visible = True lbl1.Visible = True Lbl2.Visible = True Lbl3.Visible = True BtnIniciar.Visible = False Btnserra.Visible = False Btnhadad.Visible = False Btnnulo.Visible = False Btnsecao.Visible = False Btnserra.Visible = False Btnencerrar. Visible = False If Txtvotos.Text = Txtvotoh.Text Then lbl1.Text = "Saw: " & Txtvotos.Text & " votes." Lbl2.Text = "Hadad: " & Txtvotoh.Text & " votes." Lbl3.Text = "Null: " & Txtvoton.Text & " votes." Lblempate.Visible = True Btnnovaeleicao.Visible = True Lblempate.Text = "There was a tie, new ELECTION needed" Txtvotos.Text = 0 Txtvotoh.Text = 0 Txtvoton.Text = 0 ElseIf Txtvotos.Text > Txtvotoh.Text Then lbl1. = "1st Serra: " & Txtvotos.Text & " votes. ELECTED." Lbl2.Text = "2nd Hadad: " & Txtvotoh.Text & " votes." Lbl3.Text = "Null: " & Txtvoton.Text & " votes." Else lbl1.Text = "1st Hadad: " & Txtvotoh.Text & " votes. ELECTED." Lbl2.Text = "2nd Serra: " & Txtvotos.Text & " votes." Lbl3.Text = "Null: " & Txtvoton.Text & " votes." End If End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal and As System.EventArgs) Handles MyBase.Load Btnserra.Visible = False Btnhadad.Visible = False Btnnulo.Visible = False Btnencerrar.Visible = False BtnIniciar.Visible = True Btnsecao.Visible = False Btnsair.Visible = False Btnnewelection.Visible = False lbl1.Visible = False Lbl2.Visible = False Lbl3.Visible = False Lblempate.Visible = False Lblescolha.Visible = False Txtvotos.Vixible = False Txtvotos. False Txtvoton.Visible = False End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal and As System.EventArgs) Handles BtnIniciar.Click Btnserra.Visible = True Btnhadad.Visible = True Btnnulo.Visible = True Btnencerrar.Visible = False BtnInitiar.Enabled = False Btnsecao.Visible = False lbl1.Visible = False Lbl2.Visible = False Lbl3.Visible = False Lblescolha.Visible = True Txtvotos.Visible = False Txtvotoh.Visible = False Txtvotonse.Visible = False Txtvotonse.Visible Btnhadad.Enabled = True B tnnulo.Enabled = True Lblescolha.Enabled = True End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal and As System.EventArgs) Handles Btnsecao.Click Btnserra.Visible = False Btnhadad.Visible = False Btnnulo.Visible = False Btnencerrar .Visible = False BtnInitiar.Enabled = True BtnIniciar.Visible = True Btnsecao.Visible = False Btnsair.Visible = False lbl1.Visible = False Lbl2.Visible = False Lbl3.Visible = False Lblempate.Visible = False. .Visible = False Txtvotoh.Visible = False Txtvoton.Visible = False End Sub Private Sub Btnsair_Click(ByVal sender As System.Object, ByVal and As System.EventArgs) Handles Btnsair.Click Close() End Sub Private Sub Btnnovaeleicao_Click(ByVal sender As System.Object, ByVal and As System.EventArgs) Handles Btnsair.Click Close() End Sub Private Sub Btnnovaeleicao_Click(ByVal sender As System.Object, ByVal and As System.EventArgs) Handles Btnnovaeleicao.Click Btnserra.Visible = False Btnhadad.Visible = False Btnnulo.Visible = False Btnencerrar.Visible = False BtnIniciar.Enabled = True BtnIniciar.Visible False Bt nsair.Visible = False lbl1.Visible = False Lbl2.Visible = False Lbl3.Visible = False Lblempate.Visible = False Lblescolha.Visible = False Txtvotos.Visible = False Txtvotoh.Visible = False Txtvoton.Visible = Class False

Please leave your comments regarding the electronic voting machine.

 450 Total Visualizações,  3 Visualizações Hoje

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.