65.9K
CodeProject is changing. Read more.
Home

ROBO FORM

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.64/5 (14 votes)

Jul 7, 2005

viewsIcon

50839

downloadIcon

1511

Using Clipboard

Sample Image - roboform.jpg

Introduction

The robofrom send data to all text fields. You can use roboform for member forms ,notepad , wordpad etc. The forms are filled easily and quickly with robofrom. So you save from the time. I saw similar programme on the internet but it wasn’t free.So I decided to make this programme.

ROBOFORM

Following XML document uses for labels’ texts;

    <control name="Label1">Select Profile : </control>
    <control name="Label2">NAME : </control>
    <control name="Label3">MI NAME : </control>
    <control name="Label4">LAST NAME : </control>
    <control name="Label5">NICKNAME : </control>
Tags uses for all controls’ text on the form. You can change language if you want.

Functions and Subs for roboform;

      Public Function tabcontrol(ByVal tabs As tabcontrol)
        Dim tp As TabPage
        For Each tp In tabs.TabPages
                conttext(tp)
            For Each cont As Control In tp.Controls
                conttext(cont)
            Next
        Next
      End Function
Read ‘name’ attribute ,if name is equals to controls’ name then get string from XML.
      Public Sub conttext(ByVal c As Control)
            Dim tr As New XmlTextReader("english.xml")
            While tr.Read
                If tr.Name = "control" Then
                    If c.Name = tr.GetAttribute("name") Then
                        c.Text = tr.ReadElementString
                    End If
                End If
            End While
            tr.Close()
      End Sub

Listboxs double click;

Get data from listboxs and keep in the Clipboard then send data to cursor.

          Clipboard.SetDataObject(lb1.SelectedItem.ToString)   ’get string
          SetActiveWindow(8975651603260375040) ‘set focus to active window
‘ctrl + V = Paste
          keybd_event(VK_CONTROL, 0, 0, 0)  ‘send ctrl key to system
          keybd_event(VK_V, 0, 0, 0)         ‘send V key to system 
          keybd_event(VK_V, 0, KEYEVENTF_KEYUP, 0)   ‘release V key
          keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0) ‘release ctrl key