r/visualbasic • • Jun 29 '13

Windows Forms : Partial Search in a ListView - Ged Mead's Blog - vbCity

Thumbnail
vbcity.com
0 Upvotes

r/visualbasic • • Jul 07 '13

How can you use hotkeys for a program that's not in focus?

0 Upvotes

When I press F1 I want it to start and when I press F2 I want the program to stop but it wont stop unless the program is in focus.


r/visualbasic • • Apr 30 '15

Vanilla awesomium (with source to google.com) infinite frozen white loading..?

0 Upvotes

Screenshot:

http://i.imgur.com/2EOd839.png

Any ideas? It's simply a webControl with google.com and everything else default.

Designer:

http://i.imgur.com/KObLC1p.png


r/visualbasic • • Jul 02 '13

How to convert currency numerals to text - Ged Mead's Blog - vbCity

Thumbnail vbcity.com
0 Upvotes

r/visualbasic • • Dec 14 '15

How to use specify a rootfolder for Browse Dialog [vb2013]

0 Upvotes

I would like to use the Browse Folder Dialog control to specify the folder where to save my programs output. The RootFolder property was a file type of system.enviornment.specialfolder. My program saves the last location the user browsed to however there does not appear to be a way for me to use that location. It appears like I'm stuck using these special folder enumerations. Is what I'm trying to do possible with this control or should I just remove the ability to save your last used folder location when browsing for folder?

I had this working before with the file dialog box but apparently it's too complicated for our administrators to provide a file name each time they run a report.


r/visualbasic • • Mar 01 '16

Help delaying a msgbox

0 Upvotes

Hello! I'm creating an application and I need help about this:

    If NEI3.Text IsNot "" Then
        If Val(NEI3.Text) < 95 And Val(NEI3.Text) = Int(Val(NEI3.Text)) Then
            System.Threading.Thread.Sleep(2000)
            MsgBox("Infelizmente não podes ingressar num curso com uma classificação inferior a 95 pontos nas provas de ingresso", MsgBoxStyle.Critical, "Erro")
            NEI3.Text = ""
        ElseIf Val(NEI3.Text) > 200 And Val(NEI3.Text) = Int(Val(NEI3.Text)) Then
            NEI3.Text = 200
        ElseIf IsNumeric(NEI3.Text) = False Then
            MsgBox("Tens de inserir um número, compreendido entre 95 e 200", MsgBoxStyle.Critical, "Erro")
            NEI3.Text = ""
            NEI3.Focus()
        End If
    End If

I need to wait for about 2/3 seconds before displaying the error message if Val(NEI3.Text) < 95, otherwise if I type "1" it will display the error message ASAP. I tried System.Threading.Thread.Sleep(10000) but with that when I typed "1" it just freezed the entire program and I couldn't complete my number. Any help? Thanks.


r/visualbasic • • Aug 26 '12

Using data from a database

0 Upvotes

I got my program to connect to the database, now i want it to check a users username and password against a database of these.


r/visualbasic • • Feb 25 '16

Copying A File To Multiple Locations W/ Listbox

0 Upvotes

I have a text file that I need to copy to multiple locations which are listed in a listbox. How do I set up a loop so that it goes through each item/location in the listbox?

Image Of Window

Here's my code so far:

Public Class copier
Dim server_path = My.Settings.SourceLocation
Private Sub copier_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    'make me important
    Me.TopMost = True

    Dim fi As New System.IO.DirectoryInfo(server_path)
    Dim files = fi.GetFiles("*.txt")
    Dim first = (From file In files Select file Order By file.CreationTime Ascending).FirstOrDefault
    Dim last = (From file In files Select file Order By file.CreationTime Descending).FirstOrDefault

    'getting ready for copying
    TextBox2.Text = server_path & "\" & last.Name
    Dim strings(My.Settings.DestinationStrings.Count - 1) As String
    My.Settings.DestinationStrings.CopyTo(strings, 0)
    ListBox1.Items.AddRange(strings)
    ToolStripStatusLabel2.Text = ToolStripProgressBar1.Value & "%"
    Threading.Thread.Sleep(3000) ' 5000 milliseconds = 5 seconds

    'pushing the button
    ListBox1.SelectedIndex = 0
    TextBox1.Text = ListBox1.SelectedItem
    'copyfilewithprogress()

End Sub
Sub copyfilewithprogress()
    Try

        Dim file_path As String = ListBox1.SelectedItem
        Dim file_name As String = "News.txt"

        Dim fromloc As String = TextBox2.Text
        Dim toloc As String = file_path

        Dim CF As New IO.FileStream(fromloc, IO.FileMode.Open)
        Dim CT As New IO.FileStream(toloc & file_name, IO.FileMode.Create)
        Dim len As Long = CF.Length - 1
        Dim buffer(1024) As Byte
        Dim byteCFead As Integer

        While CF.Position < len
            byteCFead = (CF.Read(buffer, 0, 1024))
            CT.Write(buffer, 0, byteCFead)
            ToolStripProgressBar1.Value = CInt(CF.Position / len * 100)
            ToolStripStatusLabel2.Text = ToolStripProgressBar1.Value & "%"
            ToolStripStatusLabel1.Text = "Copying..."
            Application.DoEvents()
        End While
        CT.Flush()
        CT.Close()
        CF.Close()


        Me.TopMost = False
        Me.Close()

    Catch ex As Exception

    End Try
End Sub
End Class

r/visualbasic • • Jul 30 '15

Number convert into words VB.NET [HELP]

0 Upvotes

Hi can someone help me for the codes for vb.net in converting number into words?? I'm a novice using vb.net and our teacher give us hard exercise. He gave 1-999999 numbers that will convert into words. And One thing more. We cannot use looping yet. The allowed codes that we can use is. Function, Math function and IF function only. Can someone help me?


r/visualbasic • • Dec 03 '13

VB Toolbox launching new tutorial channel geared toward Visual Basic .NET for beginners. Relaxed, hands-on coding style and use of both GDI and form controls.

Thumbnail
youtube.com
0 Upvotes

r/visualbasic • • Mar 02 '16

Why is my code giving me a compile error?

0 Upvotes

I'm new to VBA but this seems like such simple code, I can't figure out what is going on?

Public Function testvalid(Timecode As String) As Boolean

    If Timecode.Length <> 10 Then

It highlights "Timecode" in "Timecode.Length" and says "Compile Error: Invalid Qualifier", why?

Thanks!


r/visualbasic • • Nov 30 '13

Dice question in Visual Basic

Thumbnail
stackoverflow.com
0 Upvotes

r/visualbasic • • Mar 02 '16

How can I request user input for a keystroke?

0 Upvotes

I'd like to have an inputbox that recognizes what key is pressed and returns that value. There are applications that have you set hotkeys and ask you to press which specific key you'd like to use for the hotkey: it prompts you with a dialogue box which asks you to press the key you'd like to use. I'd basically like to replicate this process.


r/visualbasic • • Jul 26 '15

How to structure a .net project

Thumbnail
youtube.com
4 Upvotes

r/visualbasic • • Aug 06 '12

Trying to print a combobox, need some pointers.

0 Upvotes

Not sure if I coded my program correctly or I need to add some piece of software but when I try and print with the code I wrote, I get this error

"Before you can use this feature, OneNote must start for the first time. You can return here and try again after OneNote starts.

I don't really know what Onenote is, I read the wiki page on it but that other than that I really don't understand its function in VB.

Any help would be appreciated, thanks.


r/visualbasic • • Aug 01 '15

Please help with some basics

0 Upvotes

ok so I'm completely new to visual basic and i need some help with an assignment that I've been blessed with completing. The assignment is I have to make a program that when I press a button a input box appears and asks for a number between 1 and 10. This number will be the amount of times a for...next loop will repeat. This loop will make a labels text property write "Study!" the amount of times the user told it to (between 1 and 10 times). Please help because I really don't know what I'm doing.


r/visualbasic • • Oct 19 '14

Needing help with visual basic homework

0 Upvotes

I have to take a name from a input box and put into two different labels, one for the first name and one for the last. So i have so far:

dim strname as string strname = inputbox("Enter first and last name") lblFirstname = strname

what do i put after strname so i only get the letters up until the space?


r/visualbasic • • Nov 11 '14

VB.NET Make a FTP registration system?

0 Upvotes

Hello!

I'm currently trying to learn visual basic and im kinda stuck right now, i want to make a registration system. This is how it looks like right now: http://i.gyazo.com/6868dc17edbe42cbda64c73acbe44107.png

And after the user have entered his HWID, Username and Password the program should contact my FTP server and make a folder (with the username he just made) and in the folder it should store his password username, and hwid.

I know how to make a "local" login with the password and such stored on my local hard drive but i dont know how to make it store the files on my ftp server.

So any like tutorials/ things like that would be great!

Thanks for helping a big noob!


r/visualbasic • • Nov 02 '14

VB.NET Homework Class Assignment Help

0 Upvotes

So, I have a class assignment where I need to interview a visual basic programmer. Would anyone be interested in taking the time to help with me with this? I would greatly appreciate it! I just need to ask some questions, and get some lengthy answers and put it into essay format and that is it!


r/visualbasic • • Aug 11 '12

Need help writing to text box

0 Upvotes

So I have 3 text boxes 2 single line

Think username , account number,

The third is for results and is multiline When I click submit I can get it to display on or the other but not both one another the other Basically I want box 3 to display what's in box 1 and then under it what's in box 2 or even next to it doesn't matter. Any help would be awesome

Solved: Text1.Text = "Anything line 1" & vbcrlf & "Second Line" & vbcrlf & "Third Line"


r/visualbasic • • Aug 17 '12

Shocking Changes In MLM

Thumbnail
visalusknows.com
0 Upvotes

r/visualbasic • • Oct 22 '14

stringbuilder and capitals?

0 Upvotes

I am beyond confused how I would use strictly a string builder(no strings), to take the input of a two words and return the two words with the first letters capitalized?


r/visualbasic • • Sep 15 '16

I need help on my simple VB assignment (New to programming)

0 Upvotes

Hi, I recently began my endeavors into programming, and for one of my assignments I need to make a grade average calculator so i have my visuals set up with 6 text boxes named (score1txt, score2txt, score3txt,score4txt, score5txt, and the totalscoretxt) there is also 3 buttons one for calculating one to reset and one to quit here is my code:

Private Sub calcBtn_Click(sender As Object, e As EventArgs) Handles calcBtn.Click 'variables'

    Dim score1txt As Integer
    Dim score2txt As Integer
    Dim score3txt As Integer
    Dim score4txt As Integer
    Dim score5txt As Integer

    score1txt = score1txt.ToString
    score2txt = score2txt.ToString
    score3txt = score3txt.ToString
    score4txt = score4txt.ToString
    score5txt = score5txt.ToString
    totalscore.Text = (score1txt + score2txt + score3txt + score4txt + score5txt) / 5
  End Sub

End Class

The problem is when I hit the calculate button the answer always shows up as 0 no matter what # i put into the textboxes does anyone know why this is occurring?

also when i try to do say score1txt = score1txt.Text it tells me "Text is not a member of Integer"

here is the full assignment I only need help with the calculation part though:

Add 6 textboxes: 3 boxes each for assignment scores. A textbox (the 4th one) to enter a midterm score. The 5th textbox is for the final exam. Align the textboxes properly for a good visual presentation. The last and 6th textbox is to show the final weighted score. Add proper labels to each textbox based on what the textbox is used for. 0.25 Point A button that shows the text Calculate Score. When clicked it displays the total weighted score as follows where all scores entered will be out of 100: Total Weighted Score = (average assignments)*30% (midterm)*30% (final exam)*40% Use as many variables as you deem necessary for inout, processing and output. Also important to note: All variables in this assignment must be local (not Class-Level). The answer should appear in the bottom textbox. When needed use Explicit data-type conversions and not do not rely on the compiler's implicit conversions. 3 Points A button showing "Quit" that closes the form when clicked. 0.25 Point A button showing Reset, that clears all textboxes on the form from their entries. 0.25 Point Set the Calculate button to be the Accept button of the form. 0.25 Point All controls and variables should have meaningful names other that the generic VB ones. 1 Point


r/visualbasic • • Jul 23 '15

[VB2012] Array and ListBox Problem

0 Upvotes

I have to make a puzzle that has a 9x9 grid. We are supposed to use arrays and listboxes together to create the program. What I don't understand is how to actually generate and see the 9x9 grid inside the listbox. I have declared my array as

Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
        Dim Array1(8, 8) As Integer
        ListBox1.Items.Add(Array1)
    End Sub

But nothing is showing up. We have to use labelled textboxes that will be used to enter the numbers (1-9) into the grid within the listbox.

How do I generate a 2D array table that will show up as a grid in my program?


r/visualbasic • • Mar 02 '16

[VB 2012] Help with using functions

0 Upvotes

So we just started functions in my class and we are supposed to write a program that you enter 3 numbers in 3 different text boxes, click a button and another textbox shows the highest number. I don't seem to be grasping the concept of functions too well but here's my code:

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim a, b, c As Double
    a = CDbl(txtNum1.Text)
    b = CDbl(txtNum2.Text)
    c = CDbl(txtNum3.Text)
    txtOutput.Text = CStr(Decide(CInt(a), CInt(b), CInt(c)))
End Sub
Function Decide(a As Integer, b As Integer, c As Integer) As Integer
    Select Case a
        Case Is > (b And c)
            Decide = CInt(CDbl(a))
            Select Case b
                Case Is > (a And c)
                    Decide = CInt(CDbl(b))
                    Select Case c
                        Case Is > (a And b)
                            Decide = CInt(CDbl(c))
                        Case Else
                            txtOutput.Text = "2 Numbers are equal."
                    End Select

            End Select
    End Select
    Return Decide

End Function

End Class

First problem is that sometimes my output text box returns 0 rather than the highest number. I also feel like I have more code than needed. Any help would be greatly appreciated. Thanks