725 Posted Topics

Member Avatar for Jake.20

See if this helps. [CODE] Dim dTotal As Double = 0 '// for adding total. For Each itm As ListViewItem In ListView1.Items '// loop thru items. With itm.SubItems(1) '// shorten code for Column 2 items. '// check if Not Nothing, add to total. If Not .Text = Nothing Then dTotal …

Member Avatar for codeorder
0
216
Member Avatar for moose333

See if this helps. [B]2 RichTextBoxes, 1 Button[/B] [CODE]Public Class Form1 Private arlRtbLines As New ArrayList '// adds rtb1 lines if string is not found in a line. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim sStringToFind As String = "Rachel Dawkins" '// String to …

Member Avatar for moose333
0
246
Member Avatar for serph09

1. [B]Add reference to Microsoft HTML Object Library[/B] when working with [ICODE]DomDocument[/ICODE]. .File menu, Project/Add Reference.../COM tab/Microsoft HTML Object Library. 2. Add an import to the top of your Form for [ICODE]mshtml[/ICODE]. [CODE]Imports mshtml '// After adding the reference, Import mshtml. Public Class Form1[/CODE]

Member Avatar for codeorder
0
144
Member Avatar for lpmike

See if this helps. [CODE] Dim ExpDate As String = CDate(dgvBlock_Extend.Rows(icnt).Cells("Extend Door & Lift Expiry Date").Value).ToString("yyyyMMdd")[/CODE]

Member Avatar for lpmike
0
83
Member Avatar for crankyslap

Place this line of code in your Form's .Load event. [CODE]Control.CheckForIllegalCrossThreadCalls = False '// allow cross threading.[/CODE]

Member Avatar for HookDevil
0
2K
Member Avatar for arezz09

See if this helps to load images in a ListView. [CODE]Public Class Form1 '// ImageList used to store images for the ListView. Private myImageList As New ImageList With {.ColorDepth = ColorDepth.Depth32Bit, .ImageSize = New Size(45, 45)} Private myImagesFolder As String = "C:\TEMP" '// Folder containing images. Private Sub Form1_Load(ByVal sender …

Member Avatar for codeorder
0
163
Member Avatar for msqueen082

See if this helps. [CODE] MsgBox(Date.Now.AddDays(90).ToShortDateString) MsgBox(Date.Now.AddDays(-90).ToShortDateString)[/CODE]

Member Avatar for msqueen082
0
187
Member Avatar for nigelv1

See if this helps since you probably do not have columns added to your ListView. [CODE] Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load With ListView1 .Columns.Add("Column 1", 100) : .Columns.Add("Column 2", 100) : .Columns.Add("Column 3", 100) '// add Columns, "100" is column.Width. .View = View.Details …

Member Avatar for codeorder
0
105
Member Avatar for dariomolnar

See if this helps. [B]2 Buttons, 5 TextBoxes(.Named "txtMenu#")[/B] [CODE]Public Class Form1 Private iSelectedTextBox As Integer = 1 '// keeps track of which TextBox is selected. Private iFirstTextBox As Integer = 1 '// # of first TextBox, as "txtMenu#". Private iLastTextBox As Integer = 5 '// # of last TextBox, …

Member Avatar for codeorder
0
479
Member Avatar for salmap

Seems that you are missing your quotations for the .Value. [CODE] Dim iCount As Integer = 0 With DataGridView1 For i As Integer = 0 To .RowCount - 1 '// loop thru all Rows. If .Rows(i).Cells(0).Value = "True" Then iCount += 1 '// check for value and Then only add …

Member Avatar for codeorder
0
226
Member Avatar for msqueen082

See if this helps. [CODE] Dim arDaysOfWeek() As String = {"mon", "tue", "wed", "thr", "fri", "sat", "sun"} '// days of week in "ddd" format. Dim isValidDay As Boolean = False Dim arTemp() As String = Nothing With TextBox1 If .Text.Contains("-"c) Then arTemp = .Text.Split("-"c) For Each myDay As String In …

Member Avatar for codeorder
0
513
Member Avatar for eileenc87
Member Avatar for codeorder
0
501
Member Avatar for tim.newport

See if this helps. [CODE] Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveAsToolStripMenuItem.Click If Not Me.ActiveMdiChild Is Nothing Then '// check if Form available. MsgBox(Me.ActiveMdiChild.Name) '// get .Name of Active Form. End If End Sub[/CODE]

Member Avatar for tim.newport
0
768
Member Avatar for jaango123

See if [URL="http://www.daniweb.com/forums/post1438157.html#post1438157"]this thread[/URL] helps with extracting data from a website. Should be easy to have the code use HTTP instead of a WebBrowser.

Member Avatar for codeorder
0
123
Member Avatar for happy006

I am not really sure since I have never converted a project from vb6 to vb.net, although when loading a Form1.Designer.vb in Notepad++ or Notepad, your image code looks similar to it. Try replacing the first lines of code with these lines. [CODE]<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frm_Merge Inherits System.Windows.Forms.Form 'Form …

Member Avatar for happy006
0
380
Member Avatar for Jake.20
Member Avatar for codeorder
0
105
Member Avatar for sarifah n

[CODE]Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.KeyPreview = True '// keep focus of keys on Form. End Sub Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown If e.KeyCode = Keys.F2 Then If Button1.Enabled = True Then Button1.Enabled …

Member Avatar for sarifah n
0
92
Member Avatar for swathys

See if this helps. [CODE] MsgBox(Format(Now.AddMinutes(5), "MM/dd/yyyy hh:mm:ss tt")) MsgBox(Format(Now.AddMinutes(-5), "MM/dd/yyyy hh:mm:ss tt"))[/CODE]

Member Avatar for swathys
0
352
Member Avatar for rookanga

See if this helps to get you started with your entries. [CODE]Public Class Form1 Private myAddressBookEntries As New ArrayList '// store your entries. ArrayList is similar to a ListBox. Private arEntry() As String '// String Array to split each entry. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) …

Member Avatar for rookanga
0
293
Member Avatar for Simran Kaur

See if this helps. [CODE]Public Class Form1 '// your application's folder that contains all Forms. Private myAppFolder As String = "C:\Users\codeorder\Desktop\vb.net\WindowsApplication1\WindowsApplication1" Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim myCoolFileLineCount As Integer = 0 For Each myCoolFile As String In My.Computer.FileSystem.GetFiles _ (myAppFolder, FileIO.SearchOption.SearchTopLevelOnly, "*.*") …

Member Avatar for dxider
0
634
Member Avatar for bLuEmEzzy

[CODE] For Each item As ListViewItem In ListView1.Items If item.Checked = False Then '// check if Not Checked. MsgBox(item.SubItems(1).Text) '// get value of "item" .SubItems(1). End If Next[/CODE]

Member Avatar for bLuEmEzzy
0
158
Member Avatar for sarifah n

See if this helps. [CODE] Private Sub DataGridView1_RowsAdded(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewRowsAddedEventArgs) Handles DataGridView1.RowsAdded If DataGridView1.RowCount = 10 Then Button1.Enabled = False End Sub[/CODE]

Member Avatar for sarifah n
0
135
Member Avatar for linezero

If you were getting the [ICODE][COLOR="Red"]Conversion from type 'Match' to type 'String' is not valid.[/COLOR][/ICODE], you just needed to get the [ICODE].Value of the Match[/ICODE]. [CODE] For Each itemcode As Match In matches ListBox1.Items.Add(itemcode.Value) Next[/CODE]

Member Avatar for codeorder
1
301
Member Avatar for mrbungle

See if this helps. [CODE] With frmCitation.txtPlate If Not .Text = "" Then '// check if TextBox has text. writer.WriteStartElement("VEHICLE_LICENSE_NUMBER") '10-28 writer.WriteString(.Text.ToString) writer.WriteEndElement() End If End With[/CODE]

Member Avatar for mrbungle
0
141
Member Avatar for vn412

You are getting the error because [iCODE]mydr(9)[/iCODE] is not declared and you probably have it declared as [iCODE]mydr(8)[/iCODE] or less than 8. To check if a ListView .SubItem exists, see if this helps. [CODE] Private Sub ListView1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.Click With ListView1 If Not …

Member Avatar for codeorder
0
689
Member Avatar for more mayo

See if this helps. [CODE] For x = 0 To 7 If Not score(x) = Nothing Then totalScore += score(x) '// add to totalScore. Next[/CODE]

Member Avatar for tomato.pgn
0
2K
Member Avatar for zubaira

See if this helps. [CODE] With DataGridView2.CurrentRow CheckBox1.CheckState = CType(CInt(.Cells(0).Value), CheckState) CheckBox2.CheckState = CType(CInt(.Cells(1).Value), CheckState) End With[/CODE] .Value of "0" is Checked = False and .Value of "1" is Checked = True.

Member Avatar for codeorder
0
130
Member Avatar for MaddTechwf

See if this helps to add DropDownItems or Items to a menu. [B]1 MenuStrip(with a "File" menu item)[/B] [CODE]Public Class Form1 Private myCoolFolder As String = "C:\" Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load For Each myFile In My.Computer.FileSystem.GetFiles(myCoolFolder, FileIO.SearchOption.SearchTopLevelOnly, "*.*") '// get files. FileToolStripMenuItem.DropDownItems.Add(myFile) …

Member Avatar for MaddTechwf
0
221
Member Avatar for linezero

See if this helps to download all web files from a ListBox. [CODE] Dim myFolder As String = "C:\" '// folder to save files to. Dim sFileExtension As String = Nothing '// string to get the file extension from web file. Dim iFileNameNumber As Integer = 0 '// used to …

Member Avatar for codeorder
0
738
Member Avatar for tahamasoom

See if this helps. [B]1 TextBox, 1 Button, 3 Labels[/B] [CODE] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Select Case TextBox1.Text '// check value in TextBox. Case "5" '// if 5. Label1.Text = "15000" Label2.Text = "15%" Label3.Text = CStr(15000 * 0.1) '// multiply 15000 …

Member Avatar for codeorder
0
114
Member Avatar for ChaosCoder

See if this helps to get individual values from a CSV file. [CODE]Public Class Form1 Private myFile As String = "C:\test.csv" '// your file. Private arlCSVlines As New ArrayList '// similar to a ListBox. Private arTemp() As String = Nothing '// String Array to .Split each line. Private Sub Form1_Load(ByVal …

Member Avatar for ChaosCoder
0
2K
Member Avatar for gspeedtech

Why not create a project that will go through the entire database and correct code? CrLf is nothing but a line break, like vbNewLine. See if this helps to catch the CrLf. [CODE] Dim sTemp As String = "some" & vbNewLine & vbNewLine & "text" If sTemp.Contains(CChar(vbCrLf)) Then MsgBox(sTemp) '// …

Member Avatar for gspeedtech
0
459
Member Avatar for Mr Programmers

See if this helps. [B]1 Panel, 1 Button, 1 Timer[/B] [CODE]Public Class Form1 Private eX, eY As Integer '// get Cursor location. Private rCursorBounds As New Rectangle(0, 0, 0, 0) '// rectangle used for Collision check. Private BlockY As Integer = 0 '// declared once. Private Sub Form1_MouseMove(ByVal sender As …

Member Avatar for codeorder
0
298
Member Avatar for prince87

See if this helps. [CODE]Public Class Form1 Private iImageNumber As Integer = 0 '// for images Index in ImageLists. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load '// set .SizeMode once. PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage PictureBox2.SizeMode = PictureBoxSizeMode.StretchImage setImages() '// set images to PictureBoxes if needed. '// …

Member Avatar for prince87
0
3K
Member Avatar for Eekhoorn

[B]Eekhoorn[/B], overlooking your original posted code and seeing this, seems that you are trying to get only the file name with extension from a file's full path. [CODE] For Each file In foundFiles [COLOR="Red"] Testlength = file.Count Test = file.LastIndexOf("\") Test1 = Test + 1 FleNmLength = Testlength - Test1 …

Member Avatar for Eekhoorn
0
182
Member Avatar for m_wylie85

See if this helps. [CODE] Public Sub SaveCustomerDbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveCustomerDbtn.Click If txtCustomerSurnameOS.Text = "" Then MsgBox("Please Input Surname", MsgBoxStyle.Critical) txtCustomerSurnameOS.Focus() Exit Sub '// Skip remaining code. End If If txtCustomerForenameOS.Text = "" Then MsgBox("Please Input Forename", MsgBoxStyle.Critical) txtCustomerForenameOS.Focus() Exit Sub '// Skip remaining …

Member Avatar for Unhnd_Exception
0
154
Member Avatar for kitjo

See if this helps. [CODE] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If RadioButton1.Checked Then MsgBox("RadioButton1 is Checked.") If RadioButton2.Checked Then MsgBox("RadioButton2 is Checked.") End Sub[/CODE]

Member Avatar for kitjo
0
122
Member Avatar for swathys

See if this helps. Add a Public String in Form2 to store the language selected and add a Parameter to the Function. [B]Form2[/B] [CODE] Public sLanguageSelected As String Private Sub PlayFlash(ByVal selectedCurrentLanguage As String) FlashObj.Stop() If selectedCurrentLanguage = "LANG_MALAY" Then FlashObj.Movie = MultimediaPath & "\Ezy1-agency-Bahasa.swf" ElseIf selectedCurrentLanguage = "LANG_ENG" Then …

Member Avatar for swathys
0
145
Member Avatar for rookanga

See if this helps. [CODE]Public Class Form1 Private myItemPrices() As Double = {4.95, 6.87, 8.52, 2.99, 0.71, 0.5, 0.99} '// item Prices. Private myTax As Double = 0.06 '// Tax used to add to Total Price. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load With ListBox1.Items …

Member Avatar for rookanga
0
160
Member Avatar for m_wylie85

Also, see if this helps. [CODE]Public Class Form1 Public topping1, topping2, drink As String '// Global declared Strings. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load '// set values to your Strings. '//-- if needed to set from other Forms, use: Form1.topping1="topping here", etc. topping1 = …

Member Avatar for codeorder
0
83
Member Avatar for vb2learn

See if this helps to remove certain lines from a TextBox. [CODE]Public Class Form1 Private arTemp() As String = Nothing '// used to get all lines from TextBox. Private sTemp As String = Nothing '// used to add lines back to TextBox. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e …

Member Avatar for vb2learn
0
2K
Member Avatar for ndeniche

[CODE] Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress Select Case e.KeyChar Case "1"c, "2"c, "3"c, "4"c, "5"c, "6"c, "7"c, "8"c, "9"c, "0"c, CChar(vbBack) '// your #'s and Backspace. e.Handled = False '// allow. Case "."c '// Decimal dot. allow only one. If Not TextBox1.Text.Contains(".") Then …

Member Avatar for PdotWang
0
2K
Member Avatar for crankyslap

Not really sure since I have not uploaded anything to FTP with vb.net, but could you just not use: [CODE] Dim file() As Byte = System.IO.File.ReadAllBytes("c:\mybackups.zip") Dim file2() As Byte = System.IO.File.ReadAllBytes("c:\mybackups2.zip") Dim file3() As Byte = System.IO.File.ReadAllBytes("c:\mybackups3.zip") Dim strz As System.IO.Stream = request.GetRequestStream() strz.Write(file, 0, file.Length) strz.Write(file2, 0, file.Length) …

Member Avatar for crankyslap
0
2K
Member Avatar for markdean.expres

Check out [URL="http://www.daniweb.com/software-development/vbnet/threads/312128/1335997#post1335997"]this link[/URL].

Member Avatar for PdotWang
0
196
Member Avatar for Wolxhound90

Since your [iCODE]Dim index As Integer[/iCODE] has no value when the application loads, it is set by default to 0. .This means that any control array that uses (index), only declares one control. You have to [ICODE]ReDim[/ICODE] the control array for the Index not to be outside the bounds of …

Member Avatar for PdotWang
0
192
Member Avatar for horserider
Member Avatar for Huntondoom

Post code that saves and loads from/to your RichTextBox. AndAlso, if a TextBox loads .rtf text, then add that code as well.

Member Avatar for codeorder
0
88
Member Avatar for arezz09

See if this helps for locating only the checked items in a ListView. [CODE] For Each itm As ListViewItem In ListView1.CheckedItems MsgBox(itm.Text) Next[/CODE] Or you could use the _ItemChecked event to locate the currently checked item. [CODE] Private Sub ListView1_ItemChecked(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckedEventArgs) Handles ListView1.ItemChecked If …

Member Avatar for codeorder
0
297
Member Avatar for kieran82

What exactly are you trying to do? .Load file, modify certain lines, and save file back?

Member Avatar for codeorder
0
83
Member Avatar for Jake.20

See if this helps. [CODE] Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress Select Case e.KeyChar Case "1"c, "2"c, "3"c, "4"c, "5"c, "6"c, "7"c, "8"c, "9"c, "0"c, CChar(vbBack) '// your #'s and Backspace. e.Handled = False '// allow. Case "."c '// Decimal dot. allow only one. …

Member Avatar for Jake.20
0
137

The End.