Minimalist 96 Posting Pro

Maybe using show and hide is abetter way to deal with the issue.

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Form2.Show()
        Me.Hide()
    End Sub
End Class

Public Class Form2
    Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Me.Close()
        Form1.Show()

    End Sub
End Class
SoftBa commented: Thanks man. This is behavior I was looking for. +2
Minimalist 96 Posting Pro

So o.k ifyou want to stick with vb6 then you could do the following;

Dim txtlen As Integer ' the length ofwords
Dim lencount As Integer ' the integer to hold the number of words longer then 6
lencount = 0 ' inialise to 0
Dim wordarray() As String' an array to hold all words
Dim rword As Variant ' the words we return fom the array
wordarray = Split(Trim$(RichTextbox1.Text), " ")' use the split function to from the string, in may case I use a rich textbox
For Each rword In wordarray
txtlen = Len(rword)
If txtlen > 6 Then
lencount = lencount + 1 ' found a word >6 increase the counter by 1
End If
Label1 = CStr(lencount) ' put the result into a label to display
Minimalist 96 Posting Pro

O.K. if came across of being rude I do apologize as this was not the intention.

JamesCherrill commented: Well said +14
Minimalist 96 Posting Pro

Well, I am not on a network so I can't test if all instance of excel are going to be closed. However testing on my machine shows that: if you open more than one instance of excel through vb.net of directly starting excell all instances will be killed. To work out how many instance of excel your machine can see just convert the code I posted to:

Dim obj1(1) As Process
        Dim counter As Integer = 0
        obj1 = Process.GetProcessesByName("EXCEL")
        For Each p As Process In obj1
            counter += 1
        Next
        Debug.Print(counter.ToString)
    End Sub

If you don't run an instance of excel the counter should be 0 which means also that either your machine is not running excel and no one else is running excel, hence you can kill all instances of excel. If you however not running excel and the counter >0 you need to find a way to only kill your instances of excel and there the process id comes in. Follow the link I posted.

ddanbe commented: Helpful. +15
Minimalist 96 Posting Pro

The sledgehammer method would be to close all excel processes. This can be done with:

  Dim obj1(1) As Process
            obj1 = Process.GetProcessesByName("EXCEL")
            For Each p As Process In obj1
                    p.Kill()
                Next

However, if others are also using excel , their processes will also be killed.
Reference the this discussion:
http://stackoverflow.com/questions/11761379/excel-process-still-runs-after-closing-in-vb-net

rproffitt commented: Starts up Peter Gabriel's Sledgehammer. Thanks. https://www.youtube.com/watch?v=g93mz_eZ5N4 +11
Minimalist 96 Posting Pro

You can only split on a charcter I think. So you need to replace "<br/>" with say "," and then you split the string, like:

Dim s As String = "cat dog <br/> red green <br/> car box <br/> "
        Dim s2 As String = ""
        s2 = s.Replace("<br/>", ",")
        Dim s3() As String
        s3 = s2.Split(","c)
        For Each st As String In s3
            Debug.Print(st)
        Next
Minimalist 96 Posting Pro

I hope the person who posted the question 7 years ago has waited all the time to get your answer. Just keep on doing the good work.

Minimalist 96 Posting Pro

Had anyone else problems with this add on. Seems to be almost impossible to get rid of it

Minimalist 96 Posting Pro

I like to see a button to move to the next page in a thread on top of the thread. Now, if a thread spans more pages I have to scroll to the bottom of each page to go to the next page. Maybe I missed a shortcut?

dtpp commented: spot on +0
Minimalist 96 Posting Pro

Every vb.net program has colections of the controls that are contained within. You can get all the controls with something like:

  For Each ctl As Control In Me.Controls
    'do something
     Next

which will loop theough all controls.
With my code I restrict the controls to the type of label:

 For Each Cont As Label In Me.Controls.OfType(Of Label)()
           'do something
        Next

Cont just means control.
So, since we running through all the controls you don't need another loop.
So, cont.name is a controls name,in this xase a label, and we use this to get to the control you want by using the how the name text ends: Inyour case with a number, this what
If Cont.Name.EndsWith(condi) Then
does since cont.name is the name of the label, which is text whixh I feed through textbox1.text.
So the only thing you have to do replace my names with what you want, place a second for .. next loop for the textboxes and the apply your condition.

Minimalist 96 Posting Pro

Well, he got already the controls array. As I said it depends just on the conditions. To get all labels with a condition from a textbox I would use something like:

Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Application.Exit()
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Dim condi As String = TextBox1.Text
        For Each Cont As Label In Me.Controls.OfType(Of Label)()
            If Cont.Name.EndsWith(condi) Then
                Cont.Visible = False
            Else
                Cont.Visible = True
            End If
        Next
    End Sub

End Class
Minimalist 96 Posting Pro

Could also be done just using vb.net and regex. I create a lookup list first to filter the lines out that get used. Than clean it all up.

Imports System.IO
Imports System.Text.RegularExpressions
Public Class Form1
    Dim lookList As New List(Of String)
    Dim indexlist As New List(Of Integer)
    Dim found As Integer = 0
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        If My.Computer.FileSystem.FileExists(mpath) Then
            Dim readText() As String = File.ReadAllLines(mpath)
            For Each lin As String In readText
                TextBox1.Text = TextBox1.Text & vbCrLf & lin
            Next
        End If
        lookList.Add("Monday")
        lookList.Add("Tuesday")
        lookList.Add("Wednesday")
        lookList.Add("Thursday")
        lookList.Add("Friday")
        lookList.Add("Saturday")
        lookList.Add("Sunday")
        lookList.Add("Created:")
        lookList.Add("Updated:")
        lookList.Add("Location:")
        lookList.Add("Shift")
        lookList.Add("Car")
        lookList.Add("Bus")
        lookList.Add("Created:")
        'Apply filter
        Dim str As String = ""
        For Each words As String In lookList
            For Each lin As String In TextBox1.Text.Split(vbNewLine)
                If lin.Contains(words) Then
                    str = str & vbCrLf & lin
                End If
            Next
        Next
        str = str.Replace("�", "°")
        TextBox1.Text = str
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Application.Exit()
    End Sub
    Function StripTags(ByVal html As String) As String
        ' Remove HTML tags.
        Return Regex.Replace(html, "<.*?>", " ")
    End Function
    Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
        Dim str As String = Trim(TextBox1.Text)
        str = str.Replace("<br/>", vbCrLf)
        TextBox1.Text = str
        'Remove tags
        Dim html As String = TextBox1.Text
        Dim Tagless As String = StripTags(html)
        TextBox1.Text = Tagless
        'Move to Listbox
        str = Trim(TextBox1.Text)
        str = str.Replace(" ", "")
        TextBox1.Text = str
        '-------------
        Dim match As String = (vbLf & vbCr)
        Dim lineIndex As Integer = 0
        For Each …
Minimalist 96 Posting Pro

I have been there before and ended up writing a .bat file to a) move some files to the correct directories and b) register some controls(before by hand via cmd). This fixed the problems. Here is a complete quote from superuser:
"
download from Microsoft this tool for Exchange 2000, that incidentally is a VB6 program redistributed with msstdfmt.dll
run the program, extracting its contents to a folder of your choice
copy msstdfmt.dll to c:\windows\system32 if running on 32 bit OS or to c:\windows\syswow64 if running on a 64 bit OS
open a command prompt (cmd.exe) with administrator privileges
in the prompt type on 32 bit OS
regsvr32 c:\windows\system32\msstdfmt.dll
or on 64 bit OS
regsvr32 c:\windows\syswow64\msstdfmt.dll
"
I also checked out on win98 (vitual machine) where files got installed. This way you can see where troubling files should be. Last word, do a rewrite with vb.net, using the latest free version to avoid all these troubles in the future.

Minimalist 96 Posting Pro

Here I mostly used your code but added a list to store your strings and a listbox to display these.

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        Dim idList As New List(Of String)
        Dim i As Integer = 1
        Dim txtProps As String = ""
        Dim objReader As New System.IO.StreamReader(propFileName)
        ListBox1.Items.Clear()
        If System.IO.File.Exists(propFileName) = True Then
            Do While objReader.Peek() <> -1
                txtProps = objReader.ReadLine()
                idList.Add("Props " & i.ToString & ", PropId  " & txtProps) 'add the properties to the list
                i += 1
            Loop
        End If

        'display strings in lisbox
        For i = 0 To idList.Count - 1
            ListBox1.Items.Add(idList.Item(i))
        Next
    End Sub
Minimalist 96 Posting Pro

You need to apply some division to the file.length as this comes in bytes based on the charcters in your file. Here are some of the divisions:
info.Length / 1024 '= kilobytes
info.Length / 1048576 ' =megabytes
info.Length / 1073741824 '= gigabytes

Minimalist 96 Posting Pro

I moved straight to the newest version of vb.net. Especially the API calls were a headache foe me. Got rid of these now as they were always a problem (16 bit to 32 bit to 64 bit). I think you also might save time moving to vb.net and learning at the same time.

Minimalist 96 Posting Pro

Looks more like a select case statement where there are more than one clause. See a good example of it here:
https://msdn.microsoft.com/de-de/library/cy37t14y.aspx

Minimalist 96 Posting Pro

To find the line that throws the exception try the following:
On the menu bar in visual basic:
1) Click on the 'Debug' menu item
2) Click 'Exceptions...'
3) Select 'Common Language Runtime Exceptions' - 'Thrown'
This should stop the program at the line the exception is thrown in.

Minimalist 96 Posting Pro

You also need to add like this:
ListView1.Items.Add(Me.txtDescription.Text).SubItems.Add(Me.txtPrice.Text)

Minimalist 96 Posting Pro

It's hard to understand what exactly you want to do. However, to put a fframe around the chart you use:
Chart1.BorderSkin.SkinStyle = BorderSkinStyle.FrameThin1
and you can play around with different frames.

O.K. another way is to use the properties of the chart. Set BorderlineColor to black, BorderlineDashStyle to solid and than you can change the line thickness of the border

Minimalist 96 Posting Pro

You need to use the textbox in vb6 and set the password character in the peoperties.

Minimalist 96 Posting Pro

Yes you need to assign your value properly. Otherwise start your loop at the top and go down. That should work.
For i As Integer = dt.Rows.Count - 1 To 0 step -1

Minimalist 96 Posting Pro

One way of doing it is to capture your form into memory as a bitmap, resize the bitmap and than print it. That might make the font too small?

Minimalist 96 Posting Pro

You are aware that you let the compiler do your conversions from text to decimal. Put option strict on and you will get some errors.Why? because you are multiplying text as in:

 txtEur.Text = txtDollar.Text * 0.89

It is much better to declare variables correctly like:
Dim DecDollar as Decimal =0 etc.

ddanbe commented: So true! +15
Minimalist 96 Posting Pro

This snippet should give you an idea of how to work the difference out:

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim str As String = ""
        Dim format As String = "HH,mm"
        Dim diff As TimeSpan
        Dim constSt As TimeSpan = New TimeSpan(0, 8, 0, 0, 0) 'Constant start Time
        Debug.Print(constSt.ToString)
        Dim start As TimeSpan = TimeSpan.Parse(Now.ToShortTimeString) 'actual start time
        diff = start - constSt 'difference in hours,minutes,seconds
        Debug.Print(diff.ToString)
    End Sub
Minimalist 96 Posting Pro

The code looks at each control in the form and if finds a textbook it executes the code.
So if you only have the 8 textboxes you don't need to address these in paricular, othrewise if you have other textboxes as well you have to address only the ones you want, but if the others would contain also letters besides numbers you are also o.k.
Error checking is always a must.

This code prints the sorted numbers to the debug.window and allows this way a quick check if everything worked as expected.

For i = 0 To numArr.Count - 1
                Debug.Print(numArr(i).ToString)
 Next
Minimalist 96 Posting Pro

@Mr.M
Your comment is useless as Sanu also tries to sort text instead of numbers.
@ Sanu
As the OP stated he wants to sort numbers.
These few lines of code will do all this:

Private Sub Sort_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim numArr As New List(Of Integer) 'assuming integers
        'here we add the textbox elements if they are not empty
        For Each txt As Control In Me.Controls
            If txt.GetType Is GetType(TextBox) Then
                If Len(txt.Text) > 0 Then
                    numArr.Add(CInt(txt.Text)) ' assuming integers
                End If
            End If
        Next
        'here we sort these
        numArr.Sort()
        'here we check that all went well
        For i = 0 To numArr.Count - 1
            Debug.Print(numArr(i).ToString)
        Next
    End Sub
Minimalist 96 Posting Pro

Maybe put conn.Open() before executing:

Dim cmd As New OleDbCommand( _
            "SELECT * FROM Subjects WHERE [StudentID]= '" & StudentID.Text & "'", conn)
Minimalist 96 Posting Pro

The framework itself doesn't support renaming of projects. However, there are solutions. First make a backup of your project. Then use the first link to manually change items. The second link is to a program that may work for you.
http://msdn.microsoft.com/en-us/library/3e92t91t%28v=vs.90%29.aspx
http://www.codeproject.com/Articles/1198/Visual-Studio-Project-Renamer

@imti321
Don't post not working links.

Minimalist 96 Posting Pro

Go to Solution Explorer--- Double click on MyProject----Goto Application and where it says Icon ---- select your own Icon.

Minimalist 96 Posting Pro

O.K try to run this script in a file's directory:

set fso = CreateObject("Scripting.FileSystemObject")
dim CurrentDirectory, Fil,Fso,text,stringname,str1, fcount
dim stringfolder
    CurrentDirectory = fso.GetAbsolutePathName(".")
    stringfolder = currentDirectory
    set FLD = FSO.GetFolder(stringfolder)
    fcount=0
        For Each Fil In FLD.Files
if Fil.Name <> "Convert.vbs"  then
        fcount=fcount+1
         Filename = stringfolder & "\" & Fil.Name
            text = fso.OpenTextFile(Filename).ReadAll
text = Replace(text,vblf,vbcrlf)
text = Replace(text,vbcr & vbcr, vbcr)
text = Replace(text,"""","")
newfilename = "C" & fil.name 
 set tso = fso.OpenTextFile(newfilename, 2, True)
 tso.write text
end if
tso.Close
   Next
msgbox "Number of Files concerted  " & fcount

Name the script exactly as Convert.vbs and run it once. It should create a copy of the file with a C in front.

Minimalist 96 Posting Pro

O.K. we need to be clear about file naming in unix. Unix files don't have an extension. You can have something like: 123456.pdf to indicate a pdf file but the .pdf is not an extension like in windows but the filename. Under DOS you had the restrictions of Filename max. 8 characters and a three character extension like: 12345678.txt.
Under windows a file name, including path can now have 260 characters. So to get back to your problem:
The filename you are working with is: 20141210.104056
So a

  filePath = "O:\IPSDATA\PMS03361A\" & 20141210.104056 & ".*"

will not work since you want to search characters in the filename. So to use wild cards it has to be somethig like:
20141210.###### as this is the wild card for numbers. See also:
http://www.databison.com/string-comparison-function-in-vba/
http://answers.google.com/answers/threadview/id/191785.html

Minimalist 96 Posting Pro

This how you get the screen resolution:

 Dim intX As Integer = Screen.PrimaryScreen.Bounds.Width
 Dim intY As Integer = Screen.PrimaryScreen.Bounds.Height
 Label1.Text = (intX & " × " & intY)

and here isa little program that lets you play around with different screen sizes:

Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        ScreenResolution()
        Me.Text = "Screen Size Display"
        Label5.Text = "ChildForm width=" & "  " & Form2.Width
        Label6.Text = "ChildForm width=" & "  " & Form2.Height
        Label7.Text = "ChildForm Top" & "  " & Form2.Top - Me.Top
        Label8.Text = "Childform Left" & "  " & Form2.Left - Me.Left
        TextBox1.Text = "600"
        TextBox2.Text = "800"
        GetVersionFromEnvironment()
    End Sub
    Public Sub ScreenResolution()
        Dim intX As Integer = Screen.PrimaryScreen.Bounds.Width
        Dim intY As Integer = Screen.PrimaryScreen.Bounds.Height
        Me.Width = intX
        Me.Height = intY
        Label1.Text = (intX & " × " & intY)
        Form2.Show()
    End Sub
    Private Sub Go_Click(sender As Object, e As EventArgs) Handles Button3.Click
        Me.WindowState = FormWindowState.Normal
        Dim scWidth As Long
        Dim scHeight As Long
        scWidth = CInt(TextBox1.Text)
        scHeight = CInt(TextBox2.Text)
        'Make sure the size is acceaptable
        If scHeight >= 200 And scWidth >= 200 Then
            Me.Width = CInt(scWidth)
            Me.Height = CInt(scHeight)
            Me.CenterToScreen()
            Form2.Top = Me.Top + 20
            Form2.Left = Me.Left + 20
        Else
            MsgBox("Size Not Acceptable")
        End If
    End Sub
    Private Sub Working_Click(sender As Object, e As EventArgs) Handles Button2.Click
        ' Retrieve the working rectangle from the Screen class
        ' using the PrimaryScreen and the WorkingArea properties. 
        Dim workingRectangle As System.Drawing.Rectangle = Screen.PrimaryScreen.WorkingArea
        ' Set the …
Minimalist 96 Posting Pro

Field names with spaces in them will create problems as in "Projcet Name"
better to use Projcet_Name or brackets "[Projcet Name]"

Minimalist 96 Posting Pro

It is .Execute with a t not .Execule

Minimalist 96 Posting Pro

Maybe check the spelling first?

sqlCMD.ExecuteScalar()

Minimalist 96 Posting Pro

You need to take "Dim intSum As Integer = 0" out of the button click event, otherwise you always set it back to 0.

Minimalist 96 Posting Pro

It is not very hard if you use regex. Not knowing if you have three textboxes or one, here is some code using one textbox and three radiobuttons to change validation of the input in textbox1.

Imports System.Text.RegularExpressions

Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub
    Private Sub validatIn()
        If RadioButton1.Checked = True Then
            Dim regex As New Regex("^[0-9-]*$")
            If regex.IsMatch(TextBox1.Text) Then
                TextBox1.Text = TextBox1.Text
            Else
                MsgBox("Textbox1 only allows numbers and - ")
            End If
        End If

        If RadioButton2.Checked = True Then
            Dim regex As New Regex("^[A-Za-z.]*$")
            If regex.IsMatch(TextBox1.Text) Then
                TextBox1.Text = TextBox1.Text
            Else
                MsgBox("Textbox1 now only allows letters and .")
            End If
        End If
                   If RadioButton3.Checked = True Then
            Dim regex As New Regex("^[A-Z]*$")
            If regex.IsMatch(TextBox1.Text) Then
                TextBox1.Text = TextBox1.Text
            Else
                MsgBox("Textbox1 now only allows Upper case letters")
            End If
        End If
    End Sub
    Private Sub cmdExit_Click(sender As Object, e As EventArgs) Handles cmdExit.Click
        Me.Close()
    End Sub
    Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
        validatIn()
    End Sub
End Class
ddanbe commented: Nice! +15
Minimalist 96 Posting Pro

O.K. just a couple of points. A) The program you want to send a key combinations to need to be programmed to accept this combination. B) Windows always intercepts key presses and somewhat redirects these if the program you want to send these to doesn't accept these. So here is a small snippet using notepad to send keys to:

Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Shell("notepad", vbNormalFocus)
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        AppActivate("notepad")
        SendKeys.Send("text1")
        SendKeys.Send("{TAB}")
        SendKeys.Send("text2")
        SendKeys.Send("{TAB}")
        SendKeys.Send("{ENTER}")
        SendKeys.Send("^(a)") 'for Ctrl-A for select all
        SendKeys.Send("^(n)") 'create new notepad
        SendKeys.Send("^(s)") 'for control and S - save notepad
    End Sub
End Class
Minimalist 96 Posting Pro

You need to catch the close event like:

 Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) _
      Handles Me.FormClosing
        If e.CloseReason = CloseReason.UserClosing Then
            e.Cancel = True
            MsgBox("CLosing")
            Me.Hide()
        End If
    End Sub
savedlema commented: Thank you very much. Please see my comment +2
Minimalist 96 Posting Pro

O.K. You need to use a monospaced font which assigns each letter, number the same space, so an i would take up the same space as a w. Than you use the Rset function, where the number indecates how much you move your items to the right- depends on the width of the listbox. Here I post a few lines of code that demonstrates the use.

Private Sub Form_Load()
    List1.AddItem ("Hello")
    Dim strItem As String * 20
    RSet strItem = "Testing"
    List1.AddItem (strItem)
    Dim strItem1 As String * 10
    RSet strItem1 = "Testing"
    List1.AddItem (strItem1)
End Sub
Minimalist 96 Posting Pro

O.K. You can't just have one button to do the backup and restore at the same time. This doesn't make sense. So you need either 2 buttons, one to backup and one to restore or set a flag with a radiobutton or something else.
OK. this what I do: At the first use of my program I createall the databases and folders the program needs. So on first run I create the backup folder:

Case 14 'create the backupfolder on first run of the program
                My.Computer.FileSystem.CreateDirectory(mypath & "\" & constfoldername & "\" & "Backups") 'create workingfolder in th app directory
                InClass.Label7.Text = "Created Backup Folder"

When it comes to backing files up I first create a folder with todays date and then copy the files the user wants to back up into this folder:

Case 15 'create the backup files
                Dim st As String
                st = Now.ToString("D")

                If My.Computer.FileSystem.DirectoryExists(mypath & "\" & constfoldername & "\" & "Backups" & "\" & st) = False Then
                    My.Computer.FileSystem.CreateDirectory(mypath & "\" & constfoldername & "\" & "Backups" & "\" & st)
                End If

                If My.Computer.FileSystem.FileExists(mypath & "\" & constfoldername & "\" & "Globals" & "\" & "Forms.txt") Then
                    My.Computer.FileSystem.CopyFile(mypath & "\" & constfoldername & "\" & "Globals" & "\" & "Forms.txt", mypath & "\" & constfoldername & "\" & "Backups" & "\" & st & "\" & "Forms.txt", True)
                End If
Ancient Dragon commented: right +14
Minimalist 96 Posting Pro

O.K. You got the addhandler and an event. There is more to it. I have whipped up some minimal code you can start a new project,copy it in, put a button on the form, option strict = off - otherise you will get late binding errors, otherwise the code will work (VB.net express 13)

Imports System
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Text
Public Class Form1
    Dim lbl As Label
    Dim flag As Integer = 0
    Dim i As Integer = 50
    Dim dragging As Boolean
    Dim beginX, beginY As Integer
    Dim counter As Integer = 1
    Private ptX, ptY As Integer
    Private drag As Boolean
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click


        Dim lbl As New Label

        lbl.Name = "Label" & counter
        lbl.Text = lbl.Name
        lbl.Size = New Size(80, 20)

        lbl.Location = New Point(80, counter * 22)


        AddHandler lbl.Click, AddressOf labMouseClick
        AddHandler lbl.DragEnter, AddressOf labDragEnter
        AddHandler lbl.MouseDown, AddressOf labMouseDown
        AddHandler lbl.DragDrop, AddressOf labDragDrop
        AddHandler lbl.MouseUp, AddressOf labMouseUp
        AddHandler lbl.MouseMove, AddressOf labMouseMove
        Me.Controls.Add(lbl)

        counter += 1
    End Sub
    Private Sub labMouseMove(lbl As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
        If drag Then
            lbl.Location = New Point(lbl.Location.X + e.X - ptX, lbl.Location.Y + e.Y - ptY)
            Me.Refresh()
        End If
    End Sub
    Private Sub labDragDrop(sender As Object, e As DragEventArgs)
        e.Effect = DragDropEffects.Move
        Static mousePosX As Single, mousePosY As Single
        lbl.Left = lbl.Left + (e.X - mousePosX)
        lbl.Top = lbl.Top + (e.Y - mousePosY)
    End Sub
    Private Sub labMouseUp(ByVal …
oussama_1 commented: exactly +3
Minimalist 96 Posting Pro

O.K., using the examples from vb.net it is very easy to format columns, but you need to set the font of the combobox to a mono spaced font. I used Courier New. This is all the code you need:

Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim str1 As String = "WWWWWWWWWWWWWWW"
        Dim str2 As String = "Window"
        Dim str3 As String = "OnceAndTwice"
        Dim str4 As String = "Hello"
        Dim str5 As String = "one"
        Dim str6 As String = "Onehundredthousand"
        Dim format As String = "{0,-20} {1,-20} {2,-20}"
        Dim line1 As String = String.Format(format, str1, str2, str3)
        Dim line2 As String = String.Format(format, str5, str6, str2)
        Dim line3 As String = String.Format(format, str3, str5, str1)

        ComboBox1.Items.Add(line1)
        ComboBox1.Items.Add(line2)
        ComboBox1.Items.Add(line3)
    End Sub
End Class

andtheresult looks like on the jpeg.

Minimalist 96 Posting Pro

This might be what you are looking for:
http://vbcity.com/forums/t/103763.aspx

adam.wolnikowski.9 commented: Exactly what I'm looking for, but again, outdated...I guess I'm going to have to translate that code to 2013. +0
Minimalist 96 Posting Pro

There are a few pitfalls working with dates as it always depends on how the compiler works these and can make decisions on what it thinks you want. ALso if you want to compare just numbers you will see that four comes before one because f goes when sorting before o. So generally speaking google as much as you can digest about some of th code if something goe wrong. Please mark this thread as solved.Thanks

Minimalist 96 Posting Pro

@ cambalinho
Read the OP's question carefully and before telling me my code is incomplete try it first and put it in the correct event, keydown on textbox1.

Minimalist 96 Posting Pro

You can use something like this:

    Private Sub TextBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles TextBox1.KeyDown
        If e.KeyCode = Keys.Enter Then
            TextBox2.Focus()
        End If
    End Sub
Minimalist 96 Posting Pro
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim strComNAme As String = "DT-WAR-BISMITH"
        Dim strEx As String = "SMITH"
        If strComNAme.Contains(strEx) Then
            Debug.Print("Found")
        End If
    End Sub

O.K. this code works. Contains is case sensitive and I think you want to find the person name within th wcomputer name and not vise versa.

Minimalist 96 Posting Pro

Well, I do think you might want to reconsider.
1)There are already lots of these programs around.
2)VB6 doesn't cut it anymore. Why?
3)I have coded and sold a program like this coded in vb3,vb4,vb5,vb6 and now rewriting it in vb.net. You are looking at 20000 lines of code, depends how efficient your program should be. If you are on your own you are looking at one year of coding - in vb6, you are wasting your time. If you want tro look at my manual I will posted here.

Stuugie commented: At least you know what he/she means. +5