Wednesday, September 22, 2010

Wednesday, September 22


Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If My.Computer.Clipboard.ContainsText Then
TextBox1.Text = System.DateTime.Now
TextBox1.Text = TextBox1.Text + vbNewLine
TextBox1.Text = TextBox1.Text + My.Computer.Clipboard.GetText

End If
End Sub




Public time As String
Public stringClipboard As String

Public Function getTime()
Dim dateTimeInfo As String = System.DateTime.Now
Return dateTimeInfo

End Function


Public Function getString()
Dim clipboard1 As String = My.Computer.Clipboard.GetText
Return clipboard1

End Function

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick



time = getTime()
stringClipboard = getString()



If My.Computer.Clipboard.ContainsText Then
TextBox1.Text = TextBox1.Text + time + vbNewLine
TextBox1.Text = TextBox1.Text + stringClipboard + vbNewLine


End If
End Sub

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


End Sub




Public time As String
Public stringClipboardNew As String
Public pastText As String
Public i As Integer

Public Function getTime()
Dim dateTimeInfo As String = System.DateTime.Now
Return dateTimeInfo

End Function


Public Function getString()
Dim clipboard1 As String = My.Computer.Clipboard.GetText
Return clipboard1

End Function

Public Sub printSomething()
TextBox1.Text = TextBox1.Text + time + vbNewLine
TextBox1.Text = TextBox1.Text + stringClipboardNew + vbNewLine
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick



time = getTime()
stringClipboardNew = getString()
i += 1

If stringClipboardNew = pastText Then
Else
If i <= 1 Then
If My.Computer.Clipboard.ContainsText Then
Call printSomething()
pastText = stringClipboardNew
Else
Call printSomething()
End If
End If
End If


End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
pastText = 0

End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

End Sub


This is the final version of what I was try to do, it didn't work out so well, but it kind of works



Public time As String
Public stringClipboardNew As String
Public pastText As String
Public i As Integer

Public booleanResult As Boolean


Public Function getTime()
Dim dateTimeInfo As String = System.DateTime.Now
Return dateTimeInfo

End Function


Public Function getString()
Dim clipboard1 As String = My.Computer.Clipboard.GetText
Return clipboard1

End Function

Public Sub printSomething()
TextBox1.Text = TextBox1.Text + time + vbNewLine
TextBox1.Text = TextBox1.Text + stringClipboardNew + vbNewLine
End Sub

Public Sub compare(ByVal pastText As String)

stringClipboardNew = getString()
If pastText = stringClipboardNew Then
booleanResult = True
Else
booleanResult = False
End If

Return



End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick



time = getTime()


i += 1


If i <= 1 Then
If My.Computer.Clipboard.ContainsText Then
stringClipboardNew = getString()
pastText = stringClipboardNew
Call printSomething()
Else
compare(pastText)
If booleanResult = False Then
Call printSomething()
Else

End If
End If
End If




End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
pastText = 0

End Sub

No comments: