Jump to content

Recommended Posts

Posted (edited)

I wrote a text encrypting program about five years ago. The program worked fine. However, now retired (76 years old), I am fooling around with programming agin.

I cannot get the Progress bar to work. I want it to be activated by Button3 on Form3. I have commented out my attempt at a progress bar inasmuch as it did not work anyway. Here is the code...can someone please help me to get it to work? Note: Wrapping code tags around my selection of code did not produce the expected result...did not keep the carriage returns...just put everything jumbled together. So, I guess the first question should be, how can I get my code to display correctly?

 

Public Class Form3 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click End End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click 'Checks for password, desplays message if null, goes to Pass/path form5. If Form5.TextBox3.Text = "" Then MessageBox.Show("You must enter a password first.") Me.Hide() Form5.Show() End If 'Take the text from TextBox1 and assign it to string variable "Source". Dim Source As String = TextBox1.Text Dim fileReader As String 'combines password with contentents of the Text Box into string varible named, "Source". Source = strPassWordVar & Me.TextBox1.Text '********************************************************** Label3.Visible = True '**********Encrypting text...this will take awhile.*************** Me.Refresh() 'Call the Encrypt function Encrypt and pass it the Source varible. Call Encrypt(Source) '********************************************************* 'Private Sub ProgressBar1_Click(sender As System.Object, e As System.EventArgs) Handles ProgressBar1.Click ' Dim i As Integer ' ProgressBar1.Minimum = 0 ' Sets the Maximum for the progress bar to the lenght of the of the combined string (NumerOf). ' ProgressBar1.Maximum = NumberOf ' For i = 0 To NumberOf ' ProgressBar1.Value = i ' Next 'End Sub '************************************************* 'Reads encrypted from disk file into Form3 Text Box 2. fileReader = My.Computer.FileSystem.ReadAllText(strWholePathVar) Me.TextBox2.Text = (fileReader) Label3.Text = "Encryption complete." End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click 'Check that file exists If My.Computer.FileSystem.FileExists(strWholePathVar) = False Then MessageBox.Show("File was not found.") Else ' delete the file Kill(strWholePathVar) MessageBox.Show("File was deleted, directory remains.") End If End Sub End Class

Edited by Bushranger

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...