Počet zobrazení stránky

2011-04-22

Form fade in and out

This code will make fading in and out effect to your form

Public Class Form1

    Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
        Do Until Me.Opacity = 0.0
            Me.Opacity -= 0.01
            Me.Refresh()
            System.Threading.Thread.Sleep(10)
        Loop
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Opacity = 0
        Do Until Me.Opacity = 1
            Me.Opacity += 0.01
            Me.Refresh()
            System.Threading.Thread.Sleep(10)
        Loop
    End Sub

End Class 
the values could be changed to make the effect slower or faster

GetBetween function

Public Function getbetween(ByVal input As String, ByVal str1 As String, _
             ByVal str2 As String, ByVal index As Integer) As String
    
        If str1 <> str2 Then
            Dim tempdata As String = input.Replace(str1, "Ş")
            Dim data As String = tempdata.Replace(str2, "®")
            Dim tempvalue() As String = data.Split("Ş")
            Return tempvalue(index + 1).Split("®")(0)
        ElseIf str1 = str2 Then
            Dim data As String = input.Replace(str1, "?")
            Return Data.Split(str1)(index + 1)
        End If
    End Function

Usage:
getbetween("the text we want to get the value from","the first string the text is located between", "the second string the text is located between", "which value to return if there are more matches")

Example:
getbetween("Some testing string <|?TROLOL?|> blah blah  <|?some shit?|> blah blah blAH", "<|?", "?|>", 0)
'returns "TROLOL"

getbetween("Some testing string <|?TROLOL?|> blah blah  <|?some shit?|> blah blah blAH", "<|?", "?|>", 1)
'returns "some shit"

Simple handdrawing

SOURCE

PasteBin uploader

SOURCE

Move mouse to pixel by color


SOURCE