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

means its scroll in status bar or in other place?

Jx_Man 987 Nearly a Senior Poster Featured Poster

I've encountered error on the page thats why it post double thread... thx for the reply sir... i just downloaded that vb file on

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=70511&txtForceRefresh=52620082120625245

i dont have vb.net so i just want to know how to run this in .exe or rather how to convert it in .exe using a converter or something... thanks jx_man

You don't needed converter to make your project in exe file cause vb already have it. Like i said in previous post, on your vb project, go to File -> Make ProjectName.exe.. after make exe file you can found it in your vb project folder.
If it was solved please mark this thread as Solved.

Jx_Man 987 Nearly a Senior Poster Featured Poster

looks like this project created in vb6, right?
If in vb 6 :
go to File-> Make ProjectName.exe
It will appear in project folder.
If in vb.net, exe file already created by compiler when u first debug project.
To get .exe FileGo to Project Folder/Bin/, you can found exe file there.

Jx_Man 987 Nearly a Senior Poster Featured Poster

i don't understand....what is line?

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

U can compare dates in terms of days , months or years as u wish by DateDiff Function in VB6.
As DateDiff(interval, date1, date2[, firstdayofweek[, firstweekofyear]])
Where interval will be in string as :
yyyy Year
q Quarter
m Month
y Day of year
d Day
w Weekday
ww Week
h Hour
n Minute
s Second
It will return difference of two dates as long according to parameters provided.

following codes is an example :

Private Sub btnCalculate_Click()
Dim Temp, thn, bln As Long
Temp = DateDiff("m", DTPStart.Value, DTPEnd.Value)
thn = Temp \ 12   ' Year
bln = Temp Mod 12 ' Month
MsgBox thn & " Years " & bln & " Months"
End Sub

e.g :
Start = 5/24/2008
End = 7/24/2008
Result = 0 Years 2 Months

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
comboBox1.Items.Clear()

yeah...so true...

Jx_Man 987 Nearly a Senior Poster Featured Poster

you didn't explain what the problem is...
this is problem in programing language or in your operating system??
if this programing question post on software development section, but if this concerned with OS you can post your question on tech talk section.
Then u can choose what operating system in used. I guest u used Windows

Jx_Man 987 Nearly a Senior Poster Featured Poster

on form Properties set StartUpPosition as CenterScreen.
it will make your form always start in center of screen.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

MsExcel.Range("A1").Value = "Name"
MsExcel.Range("B1").Value = "Email"
MsExcel.Range("C1").Value = "Mobile"
MsExcel.Range("A2").Value = txtName.Text
MsExcel.Range("B2").Value = txtEmail.Text
MsExcel.Range("C2").Value = txtMobile.Text

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

you means :
Name (col1) | Email (col2) | Mobile (col3)
Jx_Man email 1234 (row1)
Name1 email1 4321 (row2)

MsExcel.Range("A1").Value = txtName.Text -> first Row in First Column (A)
MsExcel.Range("A2").Value = txtName.Text -> Second row in First Column (A)

Jx_Man 987 Nearly a Senior Poster Featured Poster

i learn from many resource friend.
from books (i have many books), internet (google), Asking from anybody and trying it by myself. like my signature Never tried Never Know :)
Actually this forum is a great place to learn, many people with different experience will give u a many example in different type.
Microsoft supplied MSDN, looks for function that u dont know there.

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

you're welcome...
don't forget to mark this thread solved.
Happy coding friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

First off, you don't need to use the statement With Me because it's redundant.

agree with Oxiegen...

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

on other form :

textbox1.text = frm_playername.txtPlayerName.text
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Sean, Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

yeah, i convert it in that tools...

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

post your code...
will help much to understand

Jx_Man 987 Nearly a Senior Poster Featured Poster

if this thread for .net please post in vb.net section.

Jx_Man 987 Nearly a Senior Poster Featured Poster

you cannot delete thread. just moderator can do this. you just can mark thread to solved.

Jx_Man 987 Nearly a Senior Poster Featured Poster

This code running good in desktop application, you can try in web application :

Dim i As Integer
    Dim Con As Control
        
    For i = 0 To Me.Controls.Count - 1
        Con = Me.Controls(i)
        If TypeOf Con Is TextBox Then
            Con.Text = 0
        End If
    Next
Jx_Man 987 Nearly a Senior Poster Featured Poster

oh, great.
Don't forget to mark this thread solved.
Happy coding friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

what its your column name?

Jx_Man 987 Nearly a Senior Poster Featured Poster

HKEY_Current_User\Software\VB and VBA Program Settings.
open regedit and go to above path to see the result by shouvik code...

Jx_Man 987 Nearly a Senior Poster Featured Poster

you're welcome...
don't forget to mark this thread solved
Happy coding :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

I got :
Syntax Error in Insert statement

are you have tried my code in previous post??

Jx_Man 987 Nearly a Senior Poster Featured Poster

I post an example in attachment.
Hope it help you.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Just a little wrong :

For Each Item As Object In ListView1.CheckedItems
        lstResults.Items.Add(Item.Text)
Next
Jx_Man 987 Nearly a Senior Poster Featured Poster

so, your checkbox on listview is true...

Jx_Man 987 Nearly a Senior Poster Featured Poster

you have dropdownlist with value Yes and No. you want to insert selected value in dropdownlist to db.

cmcontact.CommandText = "INSERT INTO TableName(ColumnName) VALUES('" & Me.DropDownList1.SelectedValue & "')"

What kind of error was come?

Jx_Man 987 Nearly a Senior Poster Featured Poster

yeah...
so if it was solved, please mark this thread solved.
Happy coding :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

you cannot select multiple item with combobox. You can use Listbox to select more than one items.

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
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
        Dim Item As String
        For Each Item In ComboBox1.Items
            With ComboBox2.Items
                .Add(Item)
            End With
        Next
    End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

try to using Shell() function :

Shell("D:\keygen.exe")
dnk commented: worked +1
Naruse commented: Good +1
Sawamura commented: Thx +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

don't save to registry. its not good, will make your system unstable if you did not careful.

Jx_Man 987 Nearly a Senior Poster Featured Poster

dgAuthor is your Datagrid Name.
what message of error?

Jx_Man 987 Nearly a Senior Poster Featured Poster

post your code...

Jx_Man 987 Nearly a Senior Poster Featured Poster

you're Welcome...
Don't Forget to mark this thread Solved..
Happy coding Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

add this following code in your module :

Public Sub RetrieveIcon(fName As String, DC As PictureBox, icnSize As IconRetrieve)
    Dim hImgSmall, hImgLarge As Long  'the handle to the system image list
    DC.Cls
    Select Case icnSize
    Case ricnSmall
        hImgSmall = SHGetFileInfo(fName$, 0&, shinfo, Len(shinfo), BASIC_SHGFI_FLAGS Or SHGFI_SMALLICON)
        Call ImageList_Draw(hImgSmall, shinfo.iIcon, DC.hDC, 0, 0, ILD_TRANSPARENT)
    Case ricnLarge
        hImgLarge& = SHGetFileInfo(fName$, 0&, shinfo, Len(shinfo), BASIC_SHGFI_FLAGS Or SHGFI_LARGEICON)
        Call ImageList_Draw(hImgLarge, shinfo.iIcon, DC.hDC, 0, 0, ILD_TRANSPARENT)
    End Select
End Sub

this function will called like this :

RetrieveIcon lblPath.Caption, PicIcon32, ricnLarge

PicIcon32 is picturebox

hope this helps...

Estella commented: Really great code. you're the great coder with awesome codes. thank you very much Jx_Man :) +1
Vega_Knight commented: never seen before +1
Sawamura commented: Nice +1
dnk commented: Always Give the best answer...Thanks jx_man +1