- Strength to Increase Rep
- +9
- Strength to Decrease Rep
- -2
- Upvotes Received
- 27
- Posts with Upvotes
- 22
- Upvoting Members
- 19
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Retired
- Interests
- programing, woodworking, fishing
Re: Try this: [CODE] Dim dvr As New DriveInfo("c:") Label1.Text = CStr(dvr.TotalFreeSpace / 1000000) & " MB" Label2.Text = CStr(dvr.TotalSize / 1000000) & " MB" Label3.Text = CStr(Val(Label2.Text) - Val(Label1.Text)) & " MB" [/CODE] | |
Re: There are several ways. 1. Dim x As Integer = CInt(TextBox1.Text) 2. Dim y As Integer = Val(TextBox1.Text) 3. Dim z As Integer = CType(TextBox1.Text, Integer) If you are working with hexidecimal or octal then use val because it knows what &h and &o means. The others throw an error. … | |
Re: try this: [url]http://classicasp.aspfaq.com/general/how-do-i-convert-numbers-into-words.html[/url] or [url]http://xl.barasch.com/cCo11432.htm[/url] | |
Re: Try this: [CODE] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim a As String = My.Computer.FileSystem.ReadAllText(path & "itemInfo.txt") Dim b As String() = a.Split(vbNewLine) itemListBox.Items.AddRange(b) End Sub[/CODE] | |
Re: I don't know anything about databases but try this: [CODE] If Trim(TextBox1.Text) = "" Then Exit Sub Dim lb As ListBox = New ListBox Dim s As Integer = 0 For s = 0 To ListBox1.Items.Count - 1 If InStr(ListBox1.Items(s).ToString, TextBox1.Text) Then lb.Items.Add(ListBox1.Items(s)) End If Next ListBox1.Items.Clear() For s = … | |
Re: Not knowing your file structure, this is what I came up with. File structure: [CODE]Charles,Johnson,2/11/40 Jake, Blake,3/22/53 June,Anderson,11/29/66[/CODE] Code: [CODE]Imports System.Xml Imports System.Text Public Class Form1 Dim path As String = "d:\hold\" Private Sub btnRead_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRead.Click ' Read the text document and … | |
Re: The two lines have to be on the same line. | |
Re: I have never used a ParamArray but looking at your code your average is asking for an array of integers and you are passing it only an integer. Dim i as Integer If you are passing i then define it as: Dim i() as integer | |
Re: In menu area select Build and then select Build programname. | |
Re: I assume you are putting your input to a textbox. So try this: [CODE] TextBox1.Text = InputBox("Enter number") TextBox1.Text = TextBox1.Text.Substring(0, TextBox1.Text.Length - 1) [/CODE] | |
Re: Try this if BName is a textbox. [QUOTE]MessageBox.Show("Name:", BName.Text, MessageBoxButtons.OK, MessageBoxIcon.Information)[/QUOTE] & works in vb net and vb6. | |
Re: If you are using vb 2005 then use My.Settings. See this: [url]http://www.codeproject.com/vb/net/appsettings2005.asp[/url] | |
Re: The purpose of inherits is code reuse. Therefore you can't change anything from an inherited form. You can add to it but no changes allowed. | |
Re: Try this: [CODE]Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load TextBox3.Text = "The quick brown fox jumps over the lazy dog." End Sub Private Sub FindButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FindButton.Click Dim idx As Integer = 0 idx = … | |
Re: I don't like to correct anyone but you need to get away from vb6. To do it the net way [CODE]TextBox1.Text = TextBox1.Text.Substring(1) & TextBox1.Text.Substring(0, 1)[/CODE] The first pram is the starting index (0 being the first character). If you omit the second pram then the rest of the string … | |
Re: Make your variable a class with an event. Make your class: [CODE]Public Class myVar Private mValue As Integer Public Event VariableChanged(ByVal mvalue As Integer) Public Property Variable() As Integer Get Variable = mValue End Get Set(ByVal value As Integer) mValue = value RaiseEvent VariableChanged(mValue) End Set End Property End Class[/CODE] … | |
Re: How are saving sImputLine? As I see you are overwritting it with each read. I use: [CODE] Dim ary As String() Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If My.Computer.FileSystem.FileExists("c:\test.txt") Then Dim str As String = My.Computer.FileSystem.ReadAllText("c:\test.txt") str.Split(ary, vbNewLine) End If End Sub [/CODE] Now … | |
Re: If you want to do it without using an array, try this: [CODE] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim Done As Boolean = False Dim Over As Boolean = False Dim num1 As Single = Single.Parse(TextBox1.Text) Dim num2 As Single = Single.Parse(TextBox2.Text) Dim … | |
Re: Here is how I did a undo: [CODE] Dim UndoStack As New Stack(Of Bitmap)() 'holds the backup images '========================================================================== ' Saves the picture passed '========================================================================== Private Sub PushUndo(ByVal b As Bitmap) UndoStack.Push(b) btnUnDo.Visible = True End Sub '========================================================================== ' Returns the last picture saved '========================================================================== Private Function PopUndo() As Bitmap … | |
Re: Are you talking about a file on disk or loaded into a richtext or text box? The latter two can be done with the InStr function. Unles you want to load the file into memory the first is a lot harder and slower to do. | |
Re: Try this: [CODE] Private Sub ChangeBackcolorRed(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.MouseEnter, TextBox2.MouseEnter, TextBox3.MouseEnter sender.backcolor = Color.Blue End Sub Private Sub ChangeBackcolorWhite(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.MouseLeave, TextBox2.MouseLeave, TextBox3.MouseLeave sender.backcolor = Color.White End Sub[/CODE] | |
Re: check out this site for how to delay until the process has ended to continue with the next one. | |
Re: Try this in your main form load event: [CODE] Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim process As New Process With process With .StartInfo .FileName = "perl.exe" .Arguments = "filename.pl" .WorkingDirectory = "C:\Perl\eg" End With .Start() End With End Sub [/CODE] Without the With … | |
Re: Check out these two video links: [URL="http://msdn.microsoft.com/vstudio/express/beginner/windows/tier3/"]http://msdn.microsoft.com/vstudio/express/beginner/windows/tier3/[/URL] [URL="http://msdn.microsoft.com:80/vstudio/express/sql/learning/default.aspx"]http://msdn.microsoft.com:80/vstudio/express/sql/learning/default.aspx[/URL] | |
Re: [url]http://www.a1vbcode.com/app-982.asp[/url] | |
Re: Try this[CODE] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ' String 1 Dim Position As Int16 = 0 Dim string1 As String = "This is string1. Font=Arial: FontSize=14: Color=Blue" & vbNewLine Dim myFont As New Font("Arial", 14, FontStyle.Regular, GraphicsUnit.Point) Dim myColor As Color = Color.Blue … | |
Re: This is for VB Express 2005: [CODE] For i As Integer = My.Application.OpenForms.Count - 1 To 0 Step -1 If My.Application.OpenForms.Item(i) IsNot Me Then My.Application.OpenForms.Item(i).Close() End If Next i [/CODE] | |
Re: What is index? Where are you using it? Where are you using varchar to data type numeric? There is something wrong here not in your closing, it looks fine to me. |