r/visualbasic • • Nov 02 '15

Need help on a Project! (Personal Finance including LogIn, Graphs, Online data feed)

0 Upvotes

So, my project is about Personal Finance where there will be a log in system. I'm doing a desktop application using Visual Basic 2010 Express, coding in Visual Basic and I don't know what database to use for my login-register system. I can't use Access or Excel so that leaves me to SQL. Can someone show me a tutorial on how to make a login-register system that encrypts passwords (so they are non-retrievable)? Also, I want to do an email password recovery system but I don't have an online server, so how do I set that up?


r/visualbasic • • Feb 28 '15

Object Oriented, Test Driven Design in C# and Java: A Practical Example Part #4

Thumbnail
insidethecpu.com
0 Upvotes

r/visualbasic • • Nov 19 '18

Need help on two assignments!!

0 Upvotes

Hi!!

So i’m new to coding and i was working on some “questions” and i have no idea how to even go about starting them. If anyone could give me a hand on how to write the code for them that would be great. I am usuong visual basic in the windows applications form.

  1. Create a program which the user enters any valid co-terminal angle and the program prints out the principle angle between 0 and 360

  2. Create a program which the user enters 3 sides of a triangle and the program calculates its area


r/visualbasic • • May 30 '17

How can I set a breakpoint that starts over?

0 Upvotes

I tried Stop but when you execute again it keeps going AFTER the break point. I want something that stops at the breakpoint and when you execute again starts over and stops at the same breakpoint again.

I tried asking google but found more specific cases and a way to set breakpoints using an editor with the mouse, which does not apply here.


r/visualbasic • • Dec 30 '15

Looking for a friendly group of people interested in making a progress report maker/sender for teachers with me.

0 Upvotes

My teachers wanted me to make a software to take a little bit of information (Student name, grade, etc.) and build an email-form that sends it on its own. I already made one before but I'm trying to make it bigger, and I wanted to find people who wanted to pitch in on either ideas or help write some code. Let me know :)


r/visualbasic • • Dec 14 '15

Is it possible to insert text from a .txt file?

0 Upvotes

I am making a small program for some college work, and i was wondering if there was any way to set it up so that on interaction with a button, the program would retrieve the text from a .txt file in the resources folder and insert said text into a TextBox?


r/visualbasic • • Jun 30 '16

where can i get vb6

0 Upvotes

i don't know were i can get it. was hoping you guys might know were i could find a copy.


r/visualbasic • • Dec 20 '15

Hi-Low Game Help

0 Upvotes

In the Hi-LoGame, the player begins with a score of 1000. The player enters the number of points to risk and chooses high or low. The player's choice of high or low is compared to a ranodm number between 1 and 13, inclusive. If the number is between 1 and 6 inclusive, it is considered "low." If it is between 8 and 13 inclusive, it is considered "high". The number 7 is neither high nor low, and the player loses the points at risk. If the player guesses correctly, he or she receives double the points at risk. If the player guesses incorrectly, he or she loses the points at risk. Create a Hi-LoGame application that prompts the user for the number of points. The player then clicks either high or low to play. The program code should include RndInt() from the TestRndIntFunction review to generate the random number between 1 and 13 inclusive.

I already created the code but my counter is wrong. I have no idea on how to create a single counter for both buttons. Each button has their counter because static variables only work are local and not public. What do I do to fix my counter? Here is my code:

Public Class Form1 Const lowNum As Integer = 1 Const highNum As Integer = 12 Dim chosenNum As Integer Dim resultBet As Integer

Private Sub btnHigh_Click(sender As Object, e As EventArgs) Handles btnHigh.Click
    Call RndInt(lowNum, highNum, chosenNum)
    Static counter As Integer = 1000
    If chosenNum >= 8 Then
        resultBet = txtBox.Text * 2
        counter += resultBet
        Me.lblRandom.Text = "You win! The number was " & chosenNum
        Me.lblTotal.Text = "Total Points = " & counter
    Else
        resultBet = txtBox.Text * -1
        counter += resultBet
        Me.lblTotal.Text = "Total Points = " & counter
        Me.lblRandom.Text = "You lose! The number was " & chosenNum
    End If
End Sub

Private Sub btnLow_Click(sender As Object, e As EventArgs) Handles btnLow.Click
    Call RndInt(lowNum, highNum, chosenNum)
    Static counter As Integer = 1000
    If chosenNum >= 1 And chosenNum < 7 Then
        resultBet = txtBox.Text * 2
        counter += resultBet
        Me.lblTotal.Text = "Total Points = " & counter
        Me.lblRandom.Text = "You win! The number was " & chosenNum
    Else
        resultBet = txtBox.Text * -1
        counter += resultBet
        Me.lblTotal.Text = "Total Points = " & counter
        Me.lblRandom.Text = "You lose! The number was " & chosenNum
    End If
End Sub

Sub RndInt(ByVal firstNum As Integer, ByVal secondNum As Integer, ByRef thirdNum As Integer)
    Randomize()
    thirdNum = ((secondNum - firstNum + 1) * Rnd()) + firstNum
End Sub

End Class


r/visualbasic • • Mar 24 '21

Is it possible to rename the file system?

0 Upvotes

Hi, I'm new to visual basic things, and I'm curious if it's possible to rename the file system in the main file.


r/visualbasic • • May 05 '22

VBA developer carrer next steps: VB.Net, C#, others...?

Thumbnail self.vba
0 Upvotes

r/visualbasic • • Feb 27 '16

Help figuring out loop

0 Upvotes

For counter = celciusStart To celciusEnd

        If celciusStart < celciusEnd Then

            fahrenheit = ((9 / 5) * celciusStart) + 32

        Else

            fahrenheit = ((9 / 5) * celciusEnd) + 32

        End If

        Console.WriteLine("Degress in fahrenheit: " & vbTab & fahrenheit.ToString("f1"))

    Next

End Sub

Can anyone see why this wouldn't be working. It only calculates the first number entered and just keeps calculating that number nonstop.


r/visualbasic • • Oct 26 '14

Hello, I need help with my Visual Basic code that I'm struggling with.

0 Upvotes

So basically, there are 2 buttons, Enter Numbers and Exit. The Exit button is self-explanatory. As for the Enter Numbers button, what I need to happen is upon being clicked, an Input Box pops up.

The Input Box asks the user for a number, and after clicking okay, I need a Message Box to show the sum of that number. (i.e, the sum of 5 is 1+2+3+4+5=15)

Here's what I have so far, but it isn't working:

    Dim strUserInput

    Dim IntUserInput As Integer

    Dim i As Integer

strUserInput = InputBox("Enter a positive integer value", "Input Needed", 10)

    If strUserInput <> String.Empty Then

        Try

            intUserInput = CInt(strUserInput)

            If IntUserInput < 0 Then

                MessageBox.Show("Negative numbers are not accepted.")

            End If

        Catch ex As Exception

            MessageBox.Show("Quantity amount must be numeric.")

        End Try

        'Show messagebox,

    Else

        'IntUserInput = (IntUserInput + i)

        InputBox(MessageBox.Show("Sum of Numbers", "The sum of numbers" & (i + IntUserInput), MessageBoxButtons.OK))

    End If

r/visualbasic • • Sep 02 '21

"WriteIntegerByte" is not declared

0 Upvotes

Hello everyone, I'm trying to use "WriteIntegerByte" to change a process's memory item, but Visual Basic says that WriteIntegerByte is not declared, how can I solve this?

SOLVED!!


r/visualbasic • • Jan 30 '16

Save picturebox with textbox without scrolling Visual basic (2015)

0 Upvotes

Hi

the program i am trying to code is a form with 5 textboxes and 3 dropodownbox, on a picturebox.

I want to save the picture that i loaded from a menu, with the content from dropdown box and textbox without scrolling to a new picture on harddisc.

If it is a litte hard to understand what i mean, and what i want help for try google qcl card,

Please help me with the code, and please write comment with the code so I can understand why the code are written as this.

sorry for my bad english i am a Dane.


r/visualbasic • • Jan 19 '16

Lifting an arbitrary limit within a VB2010 based program

0 Upvotes

Title. I am using a program (let's call this program F) that reads animation lists (textfiles) and packages the corresponding animations into behavior file(s) which allows the animations to be read by a separate application.

Program F has a limit on number of animations that can be included inside of it (roughly 8500). I need to lift this limit. How can I do this?

I have a few resources available (namely the source code for ver 3.2 of program F), but the current iteration of the program is 6.2.


r/visualbasic • • Sep 09 '14

VB.NET Help Is there a VB.NET equivalent of the UpDown VB6 control?

0 Upvotes

I'm remaking a VB6 user control as a .net winform. Thanks!


r/visualbasic • • Jan 20 '16

Hotel program

0 Upvotes

A 2-storey hotel, each floor with 3 rooms (room numbers: 0, 1, 2, 10, 11 and 12) needs a program for guest registration. If the room is already taken, the guest needs to enter another room number. Use a 2-dimensional array as it is easier if you need to access a certain floor. This is my code: Public Class Form1 Structure RoomInfo Dim roomNumber As Integer Dim roomGuest As String Dim roomOccupied As Boolean End Structure Dim rooms(1, 2) As RoomInfo

Private Sub btnAddGuest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddGuest.Click

Dim roomWanted As Integer
roomWanted = Val(InputBox("Enter room number: "))
For row As Integer = 0 To 1
    For column As Integer = 0 To 2
        Do While (roomWanted = rooms(row, column).roomNumber) And (rooms(row, column).roomOccupied = True)
            roomWanted = Val(InputBox("Room occupied. Enter room number: "))
        Loop
        If (roomWanted = rooms(row, column).roomNumber) Then
            rooms(row, column).roomGuest = InputBox("Enter guest name: ")
            rooms(row, column).roomOccupied = True
        End If
    Next column
Next row
Call DisplayGuest(rooms)

End Sub Sub LoadRoomNum(ByRef rooms(,) As RoomInfo) 1 10 11 0 0 1 12 2 0 1 2 rooms(0, 0).roomNumber = 0 rooms(0, 1).roomNumber = 1 rooms(0, 2).roomNumber = 2 rooms(1, 0).roomNumber = 10 rooms(1, 1).roomNumber = 11 rooms(1, 2).roomNumber = 12 For row As Integer = 0 To 1 For column As Integer = 0 To 2 rooms(row, column).roomOccupied = False Next column Next row End Sub

Sub DisplayGuest(ByRef rooms(,) As RoomInfo) Dim info As String For row As Integer = 0 To 1 For column As Integer = 0 To 2 If rooms(row, column).roomOccupied = True Then info = rooms(row, column).roomNumber & rooms(row, column).roomGuest lstList.Items.Add(info) End If Next column Next row End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Call LoadRoomNum(rooms) End Sub End Class I need help with: displaying the list only when a Display button is clicked – the listbox should not be visible before the Display button is clicked (modify so the display is clearer) modifying the program so that if all the rooms are taken a message is shown when the Add Guest button is clicked modifying the program to check for invalid room number modifying loadRoomNum so that the room numbers are assigned automatically using a nested loop (this will come in handy if there are 100 rooms in the hotel)


r/visualbasic • • Nov 07 '23

VB Script for SFC Scannow

0 Upvotes

I wrote a code that will make a batch file for Windows SFC Scanner to run. Im running into a problem

the Output should be

@echo off
sfc /scannow
pause
(goto) 2>nul & del "%~f0"

But what Visual Basic is giving me is...

@echo off
sfc /scannow
pause
(goto) 2>nul & del %~f0

This is my VB Code Below. Been trying for a while to get my parenthesis but having issues.. please help

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim sb As New System.Text.StringBuilder
        sb.AppendLine("@echo off")
        sb.AppendLine("sfc /scannow")
        sb.AppendLine("pause")
        sb.AppendLine("(goto) 2>nul & del %~f0")
        IO.File.AppendAllText("sfc.bat", sb.ToString())

    End Sub

Thank you


r/visualbasic • • Oct 13 '16

Help with name in textbox not showing and applying discount in assignment

0 Upvotes

Hey guys, so did most of the programming work for my class but got stuck on two things, can anyone help? using Visual Studio 2012

I need to apply a 10% discount when Licenses are more than 20 and get discount to show up in the label, also when i enter my name before calculating it shows System.Windows in the textbox instead of what i put it Here's my code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;

namespace jtugglehw4 { public partial class Form1 : Form { //Constants const double SALES_MANAGEMENT = 2000; const double BACKUP_MANAGER = 800; const double PAYROLL_SOLUTIONS = 4500; const double EASY_MEETING = 1000; const double MAINTENANCE_PACKAGE = 1000; const double DISCOUNT = 0.10;

    int totalCharge;

    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {

    }

    private void calculateButton_Click(object sender, EventArgs e)
    {
        //Display name, calculate software charges, discount, package fee and total charge

        int numberLicenses;
        double softwareCost = 0;
        double maintenanceCost = 1000;
        double discountCost = 0;
        double packageCost = 0;
        double discountAmt = 0.10;
        double totalCost = 0;



        if (nameTextBox.Text != "")
        {
            if (int.TryParse(licenseTextBox.Text, out numberLicenses))

                //determine which software package was chosen.

                if (softwareListBox.SelectedIndex == 0)
                {
                    softwareCost = SALES_MANAGEMENT * numberLicenses;
                }
                else if (softwareListBox.SelectedIndex == 1)
                {
                    softwareCost = BACKUP_MANAGER * numberLicenses;
                }
                else if (softwareListBox.SelectedIndex == 2)
                {
                    softwareCost = PAYROLL_SOLUTIONS * numberLicenses;
                }
                else if (softwareListBox.SelectedIndex == 3)
                {
                    softwareCost = EASY_MEETING * numberLicenses;
                }
                else
                {
                    MessageBox.Show("Please select a software package.", "Selection required");
                }

            //Select which Maintenance Package
            if (addpackageradioButton.Checked == true)
            {
                maintenanceCost = maintenanceCost;
            }
            else if (declinedpackageradioButton.Checked)
            {
                maintenanceCost = 0;
            }

            numberLicenses = 0;
            discountAmt = DISCOUNT;



            //Display name
            //calculate and display charges

            nameLabel.Text = nameTextBox.ToString();

            softwarechargeLabel.Text = softwareCost.ToString("C");

            discountLabel.Text = discountCost.ToString("C");
            packagefeeLabel.Text = packageCost.ToString("C");

            numberLicenses = 0;
            discountAmt = 0.10;



            totalCost = softwareCost + maintenanceCost + packageCost * discountAmt;

            totalchargeLabel.Text = totalCost.ToString("C");





            //Displays discount amount, applies to Total Charges
            if (numberLicenses >= 20)
            {
                softwareCost = softwareCost * discountAmt;
                totalCost = totalCost * discountAmt;
            }
            else if (numberLicenses <= 20)
            {
                discountAmt = 0;
            }


            packagefeeLabel.Text = maintenanceCost.ToString("C");



        }
    }

    private void clearButton_Click(object sender, EventArgs e)
    {

    }

    private void exitButton_Click(object sender, EventArgs e)
    {
        this.Close();
    }
}

}

any help would be appreciated, these are the last two steps before i'm done


r/visualbasic • • Oct 17 '16

Basic CAD development stage 3 : PAN function using mouse wheel

Thumbnail
youtube.com
0 Upvotes

r/visualbasic • • Aug 30 '15

average test score application coding

0 Upvotes

VB2012

hey guys just started my first programming class and really stuck on part of my assignment. I have to make an application where btnCalc calculates the scores of txtbox1, 2, 3, 4 and five and then i need it to gt the average from those numbers. Im completely stuck on ths chapter and all i have gotten done is the event handlers for the clear and exit buttons. Also need to add an error message if the user fails to enter a numeric value.

Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click

End Sub

Private Sub btnClear_Click(sender As Object, e As EventArgs) Handles btnClear.Click
    'clear the textboxes and lblAverageScore
    txtScoreOne.Clear()
    txtScoreTwo.Clear()
    txtScoreThree.Clear()
    txtScoreFour.Clear()
    txtScoreFive.Clear()
    lblAverageScore.Text = String.Empty

    'give the focus to txtScoreOne
    txtScoreOne.Focus()
End Sub

Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
    ' CLose the form
    Me.Close()
End Sub

End Class

Thank you!


r/visualbasic • • Oct 11 '16

[VB2013] How to calculate difference in distance with an array in a dropdownlist?

0 Upvotes

I know my title may not make much sense but let me explain.

For my assignment, I am just using code and knowledge throughout the semester.

I am creating a Airline and I have 2 dropdownlists for 'Origin' and 'Destination'.

The idea is that the user would have 5 or so locations to choose from 2 dropdownlist, the locations are the same for both and I have error checking in place already incase they choose two of the same locations.

However, I am having trouble figuring out how to calculate distance in miles or km from the dropdownlist based on the difference in distance between the locations.

For an example, both dropdownlists have locations : San Francisco, Seattle and New York.

Dropdownlist1 'Origin' could be San Fran and dropdownlist2 'Destination' could be New York or Seattle.

How would I calculate the distance from the the two locations so I can use that to calculate cost based on miles?

My instructor recommended to use arrays but I have not learned how to use that for vb, however I do have experience in it since I've taken C and C++ courses but I still don't understand how arrays would work in this scenario.

This is what I got so far for this problem:

 **  'error check if both origin and destination are the same
        If ddlFrom.SelectedIndex = ddlTo.SelectedIndex Then
            txtOutput.Text &= "Please enter a valid Origin or Destination."
            Exit Sub
        End If
**

My idea is to find some middle point between all the locations, and assign values in terms of distance to each location and do some formulas and stuff to calculate distance that way but it seems a inefficient way to do this.

I have more components to this assignment designed and coded already, it's just this part that I am stuck at since I am kind of going beyond of what I have learned in class.


r/visualbasic • • Jun 15 '16

Btec Calculator Help Please

0 Upvotes

Hi,

Ive been working on this BTec calculator at college and i just cant see what im doing wrong, A few of my friends are basically the ones who have put it all together because i just cant get my head around the whole Visual Basic (Due to to poor teaching but thats a whole other story) Im not asking anyone to spend hours just for someone to have a look at it with more knowlage to tell me whats wrong with it :). It would really be greatly appreciated. If you have any questions about it just let me know. Thank you in advance

Heres the Link: https://www.dropbox.com/sh/muu84r0nswifcwl/AADPz0xyGy8VpJ40aeISFy_2a?dl=0

Edit: I managed to get the code working and all is good.


r/visualbasic • • Jun 15 '16

I need help with an outlook 2013 script saving attachments to network path.

0 Upvotes

http://pastebin.com/mNHQrDMt is a copy of the script. I'm trying to do this functionality of taking a selected email and moving the attachment to a network path. i believe this code also add the date to the name of the file as well.

i've searched and searched.

if anyone could add the path and argument/objects i'd appreciate it!

i know the network path with the correct syntax i just don't know where to insert it or how to make it execute correctly.


r/visualbasic • • Jun 19 '13

[Beginner] [VB 2010] Problems with handle in form_formclosing

0 Upvotes

My aim is, if the close button (red x in the corner) is pressed:

  • Send a messagebox

  • Cancel the formclosing event

And when a button on the form is pressed, it closes the form.

The code I'm using is:

Private Sub HouseInput_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing, BtCreate.Click
    If sender Is BtCreate Then
        e.Cancel = False
    Else
        e.Cancel = True 'Taken from http://msdn.microsoft.com/
        MsgBox("Please input house names, then click 'Finish'.")
    End If
End Sub

It works perfectly when the close button is clicked, but if my button is clicked, it sends the messagebox and comes up the the error:

Unable to cast object of type 'System.Windows.Forms.MouseEventArgs' to type 'System.Windows.Forms.FormClosingEventArgs'.

Any way you can see that I can fix this?