Jx_Man 987 Nearly a Senior Poster Featured Poster

see this code, this my code to get data into combobox :

Private Sub BacaData()
        Dim i, k As Integer
        Dim cmdStudent As New SqlCommand
        Dim daStudent As New SqlDataAdapter
        Dim dsStudent As New DataSet
        Dim dtStudent As New DataTable
        Dim conn As SqlConnection

        conn = GetConnect()
        Try

            cmdStudent = conn.CreateCommand
            cmdStudent.CommandText = "SELECT * FROM Student"
            daStudent.SelectCommand = cmdStudent
            daStudent.Fill(dsStudent, "Student")
            dtStudent = dsStudent.Tables("Student")
            For i = 0 To dtStudent.Rows.Count - 1
                cmbNis.Items.Add(dtStudent.Rows(i).Item(0))
            Next

        Catch ex As Exception
            MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OKOnly, "Connection Error !!")
        End Try
        conn.Close()
    End Sub
ITKnight commented: nice snippet +1
dnk commented: thanks +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

using timer.
in timer event you can change text color.

Sawamura commented: rite +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Well, great..
Don't forget to mark this thread solved.

Jx_Man 987 Nearly a Senior Poster Featured Poster

>> filelength = filelength + file.Length
it should be objfile.length

>> filelength = filelength + file.Length
why you add filelength with file.Length?
just filelength = file.length

i suggest to make a function, so it looks neat.

Imports System.IO
...
Private Function GetFileSize(ByVal MyFilePath As String) As Long
        Dim MyFile As New FileInfo(MyFilePath)
        Dim FileSize As Long = MyFile.Length
        Return FileSize
    End Function

to call this function :

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim temp As String
        temp = GetFileSize("D:\Address.txt") / 1000

        MsgBox(temp)
    End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster
Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
    Form1.ActiveForm.Opacity = TrackBar1.Value / TrackBar1.Maximum
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

try this following code :

Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
        If Val(TextBox3.Text) > 32 Then
            TextBox3.Text = TextBox3.Text.Remove(0, Len(TextBox3.Text))
            MsgBox("input under 33")
        End If
    End Sub
jaytheguru commented: Just Superb! +1
dnk commented: cool :) +1
Jade_me commented: Great simple code +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

To call form2 you must to make an object of form2 :

Dim MainMenu as New Form2
MainMenu.show

To close form1 after called form2 :
- Don't use Me.Close cause it will close application.
- Use Dispose(), set it to false.
e.g :

Dim MainMenu as New Form2
MainMenu.show
Me.Dispose(False)
debasisdas commented: great, this is No 1 hit in google search. +13
Jx_Man 987 Nearly a Senior Poster Featured Poster

try this following code :
First Textboxt to input words = textbox2
Second to input certain char = textbox1
Button to execute and label to show result.

Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
        Dim jmlText, jmlChar, i As Integer
        jmlChar = 0 
        jmlText = Len(TextBox2.Text) 
        For i = 0 To jmlText 
            TextBox2.Focus()
            TextBox2.SelectionStart = i
            TextBox2.SelectionLength = 1
            If TextBox2.SelectedText = TextBox1.Text Then  
                jmlChar = jmlChar + 1 '
            End If
        Next
        Label1.Text = "You have " & jmlChar & " Character " & TextBox1.Text
End Sub
november_pooh commented: wow.... +1
Sawamura commented: really a nice code. +1
Jx_Man 987 Nearly a Senior Poster Featured Poster
' Return True if a file exists

Function FileExists(FileName As String) As Boolean
    On Error GoTo ErrorHandler
    ' get the attributes and ensure that it isn't a directory
    FileExists = (GetAttr(FileName) And vbDirectory) = 0
ErrorHandler:
    ' if an error occurs, this function returns False
End Function

Private Sub Form_Load()
If FileExists("H:\settings.txt") = True Then
    MsgBox "Your Code If File exists"
Else
    MsgBox "Your Code if File not found"
End If
End Sub
Sawamura commented: really nice +1
Neji commented: Great code +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

see this code :

Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim dr As OleDbDataReader
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\MyDB.mdb;")
cn.Open()
cmd = New OleDbCommand("SELECT * FROM Breakdown WHERE BFrom = '" & txtFrom.Text & "'", cn)
dr = cmd.ExecuteReader
If dr.Read()
  MsgBox "Matching Records Found"
  'write whatevr code u want here
Else
  MsgBox "Data not found"
End If
dr.Close()
cn.Close()
Estella commented: helping suggestion +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...
You want to add it and run with vb.net.
.Net doesn't have a special Script Control.
Download the Script Control (ActiveX) from Microsoft
See this link

ITKnight commented: thankss....it very helpful +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

I hope that will solved your problem.

Neji commented: yes...it was solved. thank you for great link +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

First add reference Microsoft SQLDMO Object Library.
then add this code :

Dim i As Integer
        Dim oNames As SQLDMO.NameList
        Dim oSQLApp As SQLDMO.Application
        oSQLApp = New SQLDMO.Application
        oNames = oSQLApp.ListAvailableSQLServers()
        AddHandler ComboBoxEdit4.SelectedIndexChanged, AddressOf comboBoxEdit4_SelectedIndexChanged

        For i = 1 To oNames.Count
            Me.ComboBoxEdit4.Properties.Items.Add(oNames.Item(i))

        Next i
Jade_me commented: thanks it was solved my program +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

try this :

Public Function Factorial(ByVal Number As Integer) As String
        Try
            If Number = 0 Then
                Return 1
            Else
                Return Number * Factorial(Number - 1)
            End If
        Catch ex As Exception
            Return ex.Message
        End Try
    End Function

I called this function in button click event:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
       Dim num As Integer
        num = Val(InputBox("Enter the Factorial Number"))
        MsgBox(Factorial(num))
End Sub
Sawamura commented: Well great +1
Vega_Knight commented: thank you very much for your help +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

this will detect if mouse button clicked :

Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
        If e.Button = MouseButtons.Left Then
            MsgBox("left button clicked")
        ElseIf e.Button = MouseButtons.Right Then
            MsgBox("Right button clicked")
        End If
    End Sub
Naruse commented: thx..i didn't know how easy it is +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

hmm..
when u opened vb 6 project use vb.net it will convert your project in vb.net. so u can convert your project into vb 6 first then u can open current project in vb.net.
Thats what i doing.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Well, try this code :
add this code in datagrid click event.

Dim i As Integer
i = dgAuthor.CurrentRowIndex()
MsgBox(Trim(dgAuthor.Item(i, 0)) & " - " & Trim(dgAuthor.Item(i, 1)) & " - " & Trim(dgAuthor.Item(i, 2)))

Modified as u needed.

Naruse commented: Great +1
Vega_Knight commented: :) +4
Jx_Man 987 Nearly a Senior Poster Featured Poster

you mean get data on each row?

Jx_Man 987 Nearly a Senior Poster Featured Poster

just to correct :)
Dim LengthOfTID as Integer
Anyway selvaganapathy has given the best answer.

november_pooh commented: :) +1
Estella commented: hmmm +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

the easiest way is copying current access database to backup folder.
Use FileCopy to copying file.
this following code is an example :

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        FileCopy("D:\Authors.mdb", "D:\BackUpFolder\NewBackUpName.mdb")
End Sub

So file Authors.mdb in D:\ will copying into Folder BackUpFolder

Estella commented: Nice way :) +1
dnk commented: good idea +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

just copying a .mdb file to backup folder.

november_pooh commented: Right +1
Sawamura commented: Nice +1
Jx_Man 987 Nearly a Senior Poster Featured Poster
label1.Text = dateTimePicker1.Value.ToShortDateString();
Jx_Man 987 Nearly a Senior Poster Featured Poster

initial condition

Dim i As Integer
i = dgUser.CurrentRowIndex()

i.e : (this following code will select user where id user = value of first column from selected datagrid). Of course in datagrid click event :

Private Sub dgPendidikan_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgPendidikan.Click
...
cmdUser.CommandText = "SELECT * FROM Users where IdUser ='" & Trim(dgUser.Item(i, 0)) & "'"
....
end sub
Jade_me commented: Great +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

This following code just allowed you to entered numbers only (No alphabetics or any special characters) :

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
    If (Microsoft.VisualBasic.Asc(e.KeyChar) < 48) _
              Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 57) Then
            e.Handled = True
    End If
    If (Microsoft.VisualBasic.Asc(e.KeyChar) = 8) Then
            e.Handled = False
    End If
End Sub

This following code just allowed you to entered strings / alphabetics only (no numbers or any special characters):

Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
        If (Microsoft.VisualBasic.Asc(e.KeyChar) < 65) _
            Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 90) _
            And (Microsoft.VisualBasic.Asc(e.KeyChar) < 97) _
            Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 122) Then
            'Allowed space
            If (Microsoft.VisualBasic.Asc(e.KeyChar) <> 32) Then
                e.Handled = True
            End If
        End If
        ' Allowed backspace
        If (Microsoft.VisualBasic.Asc(e.KeyChar) = 8) Then
            e.Handled = False
        End If
End Sub
ITKnight commented: lets talk about powerfull code of you. great man +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

use this following function :

Public Function Factorial(ByVal Number As Integer) As String
        Try
            If Number = 0 Then
                Return 1
            Else
                Return Number * Factorial(Number - 1)
            End If
        Catch ex As Exception
            Return ex.Message
        End Try
    End Function

I called this function in button click event:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
       Dim num As Integer
        num = Val(InputBox("Enter the Factorial Number"))
        MsgBox(Factorial(num))
End Sub
Vega_Knight commented: Help me... +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Microsoft Chart Control 6.0 (SP4)

november_pooh commented: thank you +1
Jx_Man 987 Nearly a Senior Poster Featured Poster
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Year.Text < Now.Year Then
            MsgBox("Cannot input past year")
        ElseIf Year.Text = Now.Year Then
            If Trim(Month.Text) < Now.Month Then
                MsgBox("Cannot input past month")
            End If
        End If
    End Sub
november_pooh commented: Helping me +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

This following code will display a picture after progress bar is 100 %.

Dim i as Integer
	For i = ProgressBar1.Minimum To ProgressBar1.Maximum
		ProgressBar1.Value = x
	Label1.Text = x / 100 & "%"
	If i = ProgressBar1.Maximum Then
		PictureBox1.Image = Image.FromFile _
		("C:\Pic\Me.bmp")
	End If
	Next i
Naruse commented: This man alwasy helping +1
dnk commented: kasih daaah +1
Sawamura commented: Maturnuwun mas +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...
Like Sawamura said using clipboard
Try this following procedure, u can call in any event :

Private Sub Cut()
    If Me.Textbox1.Text.Length > 0 Then
        Clipboard.SetDataObject(Me.Textbox1.SelectedText)
        Me.Textbox1.Cut()
    End If
End Sub

Private Sub Copy()
    If Me.Textbox1.Text.Length > 0 Then
        Me.Textbox1.Copy()
    End If
End Sub

Private Sub Paste()
    If Clipboard.GetDataObject.GetDataPresent(DataFormats.Text) Then
        Me.Textbox1.Paste()
    End If
End Sub
Estella commented: Worked Perfectly +1
dnk commented: Good +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Try this following code :

Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
    Editor.SelectionIndent = Editor.Width * (TrackBar1.Value / TrackBar1.Maximum)
End Sub
Sawamura commented: works perfect :) +1
Neji commented: speedy +1
november_pooh commented: never know this +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

u can sort it in database itself. u can use order by in ur query i think.

yes, this an another solution.
use order by ColumName ASC (to sort ascending)
use order by ColumName DESC (to sort Descending)

Jx_Man 987 Nearly a Senior Poster Featured Poster

so, what do you want?

Const PW = "nimda"
        Dim sInput As String

        sInput = InputBox("Enter Password to Open: ")

        If (sInput <> PW) Then
            Beep()
            MsgBox("Invalid password, cannot Open...")
        Else
            'code to delete record
        End If
ITKnight commented: Good +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Yes, i know it but your sintax is wrong, its should be C:\ not C:/
Also you don't have function to check if folder exist or not. see this following code :

Public Function FolderExist(Path As String) As Boolean

If LenB(Path) = 0 Then FolderExist = False: Exit Function

If LenB(Dir$(Path, vbDirectory)) > 0 Then
If (GetAttr(Path) And vbDirectory) = vbDirectory Then FolderExist = True
Else
FolderExist = False
End If
End Function

Private Sub Command1_Click()
Dim d, Path As String

d = Format(Now(), "dddd, yyyy mmmm dd")
MsgBox (d)

Path = "C:\Photos " & d
If FolderExist(Path) = True Then
    MsgBox "Folder is available"
Else
    rspCreate = MsgBox("Directory doesn't exist, do you wish to create it?", vbYesNo)
    If rspCreate = vbYes Then
        MkDir Path
    End If
End If
End Sub
dnk commented: Nice +1
november_pooh commented: Great +1
Naruse commented: Nice one friend :) +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

its not about date but your pathName is wrong.
should be : C:\

Jx_Man 987 Nearly a Senior Poster Featured Poster

try this following code (needed timer and statusbar with 2 panels), text to scrolling is from StatusBar panel 2 text :

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  Dim text As String
  text = StatusBar1.Panels.Item(0).Text
  StatusBar1.Panels.Item(0).Text = text.Substring(1) & text.Substring(0, 1)
End Sub

i post the screenshot too.

Neji commented: great +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Your uploaded file is not vb.net project but vb6 project. i was converted this project into exe file using vb6.

Neji commented: so your job now is converter project to exe? :D +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

actually your code is great but don't use it in textbox changed event. maybe u can convert it after user fill all the textbox.

ITKnight commented: Good point +1
Jx_Man 987 Nearly a Senior Poster Featured Poster
Private Function TimeDiff(Time1 As String, Time2 As String) As String
Dim MinsDiff As String
Dim TheHours As String
MinsDiff = DateDiff("n", Time1, Time2)
'If midnight is between times
MinsDiff = IIf(MinsDiff < 0, MinsDiff + 1440, MinsDiff)
TheHours = Format(Int(MinsDiff / 60), "00")
MinsDiff = Format(MinsDiff Mod 60, "00")
TimeDiff = TheHours & ":" & MinsDiff
End Function


Private Sub Command1_Click()
Dim x As String
x = TimeDiff(DTPicker1.Value, DTPicker2.Value)
MsgBox x
End Sub
Jade_me commented: Great code +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

it cause your cursor focus in first character after converted. then your next character will input as first character.
g -> G => first converted, cursor focus on the front of first Character : |G (| : is cursor)
ge -> Eg => |Eg
gee -> Eeg => |Eeg
geet ->Teeg => |Teeg
geeta -> Ateeg => |Ateeg

Neji commented: good explain +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

This code if u want to add - after 3 numbers :

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        If TextBox1.Text.Length = 3 Then
            TextBox1.Text = TextBox1.Text + "-"
        End If
    End Sub

This Following code if u want - (negative) will added after user input 7 numbers.

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        If TextBox1.Text.Length = 7 Then
            TextBox1.Text = Microsoft.VisualBasic.Left(TextBox1.Text, 3) + "-" + Microsoft.VisualBasic.Mid(TextBox1.Text, 4, TextBox1.Text.Length)
        End If
    End Sub
Estella commented: awesome +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

see this following code :

Private Sub AutoNumberNo()
        Dim myReader As SqlDataReader
        conn = GetConnect()
        conn.Open()
        Dim temp As String
        Try
            Dim sql As String = "SELECT MAX(NO) 'IDNumber' FROM Student "
            Dim comm As SqlCommand = New SqlCommand(sql, conn)
            myReader = comm.ExecuteReader
            If myReader.HasRows Then
                While myReader.Read()
                    temp = myReader.Item("IDNumber") + 1
                End While
            End If
            myReader.Close()
        Catch ex As Exception

        End Try
        conn.Close()
        txtId.Text = String.Concat(temp) ' result will appear in textbox txtId
    End Sub

call that procedure in button click event.
on button click event...
AutoNumberNo()
end sub

Jx_Man 987 Nearly a Senior Poster Featured Poster

Form1.Show vbModal

Vega_Knight commented: easy +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

oh... i m so sorry...
yeah that codes for vb 6, but there are same code for vb.net.
this following code for vb.net.

Dim MsExcel As Excel.Application

    Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        MsExcel = CreateObject("Excel.Application")
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        With ListBox1.Items
            .Add(txtName.Text)
            .Add(txtEmail.Text)
            .Add(txtMobile.Text)
        End With
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        MsExcel.Workbooks.Add()
        MsExcel.Range("A1").Value = txtName.Text
        MsExcel.Range("B1").Value = txtEmail.Text
        MsExcel.Range("C1").Value = txtMobile.Text
        MsExcel.Visible = True
    End Sub

- button 1 for add item from textbox to listbox.
- button 2 to add all item in listbox to excel.
- Declare Dim MsExcel As Excel.Application in top of all event. don't declare it on event cause it be a global variable.
- You can modified it as u needed.

majestic0110 commented: Excellent work. Excellent poster! +2
Estella commented: Excellent +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Go to Project -> References -> Microsoft Excel 10.0 Object Library
Then add this following code :

Dim MsExcel As Excel.Application
Private Sub Command1_Click()
MsExcel.Workbooks.Add
MsExcel.Range("A1").Value = List1.List(0)
MsExcel.Range("B1").Value = List1.List(1)
MsExcel.Range("C1").Value = List1.List(2)
MsExcel.Visible = True
End Sub

Private Sub Command2_Click()
With List1
    .AddItem (txtName.Text)
    .AddItem (txtEmail.Text)
    .AddItem (txtMobile.Text)
End With
End Sub

Private Sub Form_Load()
Set MsExcel = CreateObject("Excel.Application")
End Sub
Jade_me commented: This post help me... +1
Naruse commented: wonderful code +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Private Sub CalculateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalculateButton.Click
'Calculate and display the amounts and add to totals
With Me

If makeoverRadioButton.Checked Then
.MakeoverLabel.Text = MAKEOVER_Decimal.ToString()
If HairStylingRadioButton.Checked Then
.hairStylingLabel.Text = HAIR_STYLING_Decimal.ToString()
If manicureRadioButton.Checked Then
.manicureLabel.Text = MANICURE_Decimal.ToString()
If permanentMakeupRadioButton.Text = PERMANENT_MAKEUP_Decimal.ToString() Then
End If
End If
End If
End If
End With
End Sub

why it can be :
1. you didn't used else so your if statement become a nested if.
2. you don't assign radio button as true when you checked them in if statement.
3. your last if statement is wrong (permanentMakeupRadioButton.Text = PERMANENT_MAKEUP_Decimal.ToString)
this following code is a right :

With Me
      If makeoverRadioButton.Checked = True Then
            .MakeoverLabel.Text = MAKEOVER_Decimal.ToString()
          Else
             If HairStylingRadioButton.Checked = True Then
                 .hairStylingLabel.Text = HAIR_STYLING_Decimal.ToString()
             Else
                 If manicureRadioButton.Checked = True Then
                    .manicureLabel.Text = MANICURE_Decimal.ToString()
                 Else
                     If permanentMakeupRadioButton.Checked = True Then
                         .permanentMakeupLabel.Text = PERMANENT_MAKEUP_Decimal.ToString()
                     End If
                 End If
              End If
          End If
 End With

try it and give a feedback

Jx_Man 987 Nearly a Senior Poster Featured Poster
Dim bmData As BitmapData = glyph.LockBits(New Rectangle(0, 0, glyph.Width, glyph.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb)
Dim scan0 As IntPtr = bmData.Scan0
Dim nOffset As Integer = bmData.Stride - glyph.Width * 3

Dim pDest As Byte* = CByte(CType(scan0, void*))
For y As Integer = 0 To glyph.Height - 1
    
    For x As Integer = 0 To glyph.Width - 1
        ' Check whether transparent:
        If transColor.R = pDest(2) AndAlso transColor.G = pDest(1) AndAlso transColor.B = pDest(0) Then
            ' set to background colour
            pDest(2) = backColor.R
            pDest(1) = backColor.G
            pDest(0) = backColor.B
        Else
            ' Get HLS of existing colour:
            Dim pixel As Color = Color.FromArgb(pDest(2), pDest(1), pDest(0))
            Dim lumPixel As Single = pixel.GetBrightness()
            If lumPixel <= 0.9F Then
                Dim lumOffset As Single = lumPixel / transLuminance
                lumPixel = backLuminance * lumOffset
                If lumPixel > 1F Then
                    lumPixel = 1F
                    
                End If
            End If
            ' Calculate the new colour
            Dim newPixel As New HLSRGB(backHue, lumPixel, backSaturation)
            
            ' set the values:
            pDest(0) = newPixel.Blue
            pDest(1) = newPixel.Green
            pDest(2) = newPixel.Red
        End If
        ' Move to next BGRA
        pDest += 3
    Next
    pDest += nOffset
Next

glyph.UnlockBits(bmData)
majestic0110 commented: Brilliant helper! +2
Vega_Knight commented: Great... +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

outputTextBox.Text ="\t\t ..........\n";

Should be :

outputTextBox.Text ="\t\t ..........[B]\r\n[/B]";
Naruse commented: Great +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Visit this site
1. One
2. Two
3. Three

raymyster commented: benefited from this +0
Jx_Man 987 Nearly a Senior Poster Featured Poster

Well Great...
Happy coding friend :)

Neji commented: hmmm... +1
Jx_Man 987 Nearly a Senior Poster Featured Poster
If ListViewName.ListItems.Item(i).Checked = True Then
      ' Do anything
End If
Naruse commented: Great +1
november_pooh commented: Help me Much +1