- 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
338 Posted Topics
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. | |
Re: Try this: [CODE] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox1.Text = String.Empty Using fs As New FileStream("c:\test.txt", FileMode.Open) fs.Position = 0 Using br As New BinaryReader(fs) For x As Int16 = 0 To 3 TextBox1.Text &= Asc(br.ReadChar) & " " Next End Using End … | |
Re: It probablly means you don't have anything in dgtsCustomers.GridColumnStyles, the index is -1. | |
Re: Try this: [CODE]Public Class Form1 Dim RanNum As New Random ' Random number generator Dim DistMove As Integer = 10 ' The distance the label moves each time Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ' Add distance to label Label1.Left += DistMove ' Check … | |
Re: Some that comes to mind are: Geneology database Fishing log Bowling Secretary | |
Re: I see by your signiture that you know c# and vb6. You should have no problems picking up on vb net as it is not that different from either of them. If you don't have it get the vb express 2005 (it's free). There are tutorials on msn for convertitng … | |
Re: Try this: [CODE]Public Class Form1 Private CountDownTime As DateTime Private span As Integer = 1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Button1.Text = "Start" Then CountDownTime = Now.AddMinutes(span) Dim ts As TimeSpan = CountDownTime.Subtract(Now) labMin.Text = ts.Minutes.ToString labSec.Text = ts.Seconds.ToString Timer1.Start() Button1.Text = … | |
Re: Your problem is here: [CODE]For Index = 1 To Number Step 1 txtOutput.Text = (StarString(Index) & vbNewLine) Next[/CODE] You are replacing whatever you put in it. Try one of these: [CODE]For Index = 1 To Number Step 1 txtOutput.Text = txtOutput.Text & (StarString(Index) & vbNewLine) Next[/CODE] or [CODE]For Index = … | |
Re: If you are looking for the dos word I believe in Net it is Int32. | |
Re: They are both handled the same. [CODE] If FontDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then Me.Font = FontDialog1.Font End If [/CODE] | |
Re: If you use the Form2.Show() that the shutdown mode is set to "When last forme closes" otherwise your program will quit. | |
Re: Are you sure that Net Framework 2.0 is on the other computers? That is the only thing I can think of that could go wrong. | |
Re: If you were removing dll's then you removed the (Com1.dll ?) and it was needed by the program. Whatever, then you will have to re-reference it. | |
Re: Please give an example. An accumulator will generally add several numbers to it. A counter adds one. | |
Re: Left is no longer used in vb net. Instead of [CODE]If Left(strOrderNo, 2) <> "SO" Then[/CODE] use [CODE]If strOrderNo.Substring(0, 2) <> "SO" Then[/CODE] The first number is the starting position and the second is the number of characters to get. This also replaces the mid and right string operations. If … | |
Re: Do you really need a 1d array. Why not just put the info into the listbox. i.e. [CODE]Public Class Form1 Dim ary(4, 3) Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click For col = 0 To 3 For row = 0 To 4 ListBox1.Items.Add(ary(row, col)) Next … | |
Re: look at these might help: [url]http://www.thescripts.com/forum/thread354590.html[/url] [url]http://dotnet247.com/247reference/msgs/46/230816.aspx[/url] | |
Re: If you are using 2005 then use the My function. My.Computer. will give you a list of things on or about your computer. | |
Re: Right click on the toolbar and select "Choose Items". In the popup click on the Com tab. Scroll down till you find in and check it. | |
Re: shortest: TextBox1.Text = DateTime.Now.AddDays(-3) | |
Re: Put this in the form load event. [QUOTE] WebBrowser1.Navigate("www.google.com")[/QUOTE] |
The End.