Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Nina...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

just set WindowState on form properties as minimize

Jx_Man 987 Nearly a Senior Poster Featured Poster

seems like antivirus program

Jx_Man 987 Nearly a Senior Poster Featured Poster
'In Module
'Declare outside of class
Imports System.Data
Imports System.Data.SqlClient

Module Koneksi
    Public conn As SqlConnection
    Public Function GetConnect()
        conn = New SqlConnection("server = MyServerName;database = MyDatabaseName;Trusted_Connection = yes")
        Return conn
    End Function
End Module

Ex : load data in datagrid

'In Form
'Declare outside of class
Imports System.Data
Imports System.Data.SqlClient

'Procedure To show data in DataGrid
Private Sub ShowDataGrid()
    Dim conn As SqlConnection
    Dim cmdStudent As New SqlCommand
    Dim daStudent As New SqlDataAdapter
    Dim dsStudent As New DataSet
    Dim dtStudent As New DataTable

    conn = GetConnect()
    Try
		cmdStudent = conn.CreateCommand
		cmdStudent.CommandText = "SELECT * FROM YourTableName"
		daStudent.SelectCommand = cmdStudent
		daStudent.Fill(dsStudent, "YourTableName")
		dgStudent.DataSource = dsStudent
		dgStudent.DataMember = "YourTableName"
		dgStudent.ReadOnly = True
    Catch ex As Exception
        MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OKOnly, "Connection Error !!")
    End Try
End Sub

' Call procedure ShowDataGrid() on event Form Load 
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ShowDataGrid()  ' Load data to view in data grid
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

yes i know it for c#...but you can get a logic from that.
That's i why still post it.
Good luck :)

november_pooh commented: Try to get logic from that site :) +1
Jx_Man 987 Nearly a Senior Poster Featured Poster
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi..Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi..Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi..Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Welcome aboard too indiecorporate... :)

NB: btw kalo post usahakan ada bhs inggrisnya, soalnya membernya ntar pada marah.

Jx_Man 987 Nearly a Senior Poster Featured Poster
Jade_me commented: this for c#??? +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

put this code on module (my module named koneksi)

'In Module
'Declare outside of class
Imports System.Data
Imports System.Data.SqlClient

Module Koneksi
    Public conn As SqlConnection
    Public Function GetConnect()
        conn = New SqlConnection("server = MyServerName;database = MyDatabaseName;Trusted_Connection = yes")
        Return conn
    End Function
End Module
Jx_Man 987 Nearly a Senior Poster Featured Poster
Private Sub Timer1_Timer()
'Put timer on form and set interval to 1000 (In the properties window)

Label1.Caption = Format(Now, "hh:mm:ss")

End Sub

- What tabs?

Jx_Man 987 Nearly a Senior Poster Featured Poster

Show us your effort, Post your code.
And don't hijack other thread please...

Jx_Man 987 Nearly a Senior Poster Featured Poster

post your insert code

Jx_Man 987 Nearly a Senior Poster Featured Poster

What i means in Click Event of strip menu you can call about form.
Ex :

Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
    Dim a As New About
    a.Show
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

Refresh Datagrid.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Great Code iamthwee :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

1. you can hide close, minimize and maximize in form properties.
2. Just Call About form in menu strip click event.
3. Set splash form as Startup object.
Project -> ProjectName Properties
Properties Pages will appear. you can select splash screen as Startup Object

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

>> ListBox1.Items.Add(Prc(x).ProcessName)

thanks iamthwee for the correction.

Sawamura commented: Great code :) +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

First, you need the following declarations:

Private Const EM_GETLINECOUNT As Integer = &HBA
    Private Const EM_GETLINE As Integer = &HC4
    Private Const EM_LINELENGTH As Integer = &HC1
    Private Const EM_LINEINDEX As Integer = &HBB

    Private Declare Function SendMessageINT Lib "user32.dll" _
        Alias "SendMessageA" (ByVal hWnd As IntPtr, _
        ByVal wMsg As Integer, ByVal wParam As Integer, _
        ByVal lParam As IntPtr) As Integer

Now, I placed this code in a button click event :
Counter set = 1 to start from second line.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim LineCount As Integer = SendMessageINT(TextBox1.Handle, EM_GETLINECOUNT, 0, IntPtr.Zero)
        Dim counter As Integer = 0
        Dim LineIndex As Integer = 0
        Dim lineLength As Integer
        Dim curLine As String = ""
        Dim stringPTR As IntPtr

        For counter = 1 To LineCount - 1
            'Get Index for line we want to retrieve
            LineIndex = SendMessageINT(TextBox1.Handle, EM_LINEINDEX, counter, IntPtr.Zero)
            'GetLineLength
            lineLength = SendMessageINT(TextBox1.Handle, EM_LINELENGTH, LineIndex, IntPtr.Zero)
            'Create the buffer
            curLine = New String("0"c, lineLength + 2)
            Mid(curLine, 1, 1) = Chr(lineLength And &HFF)
            Mid(curLine, 2, 1) = Chr(lineLength \ &H100)
            'Get the pointer for a buffer
            stringPTR = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(curLine)
            'Fill the pointer with the current line
            SendMessageINT(TextBox1.Handle, EM_GETLINE, counter, stringPTR)
            'Read the line
            curLine = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(stringPTR)
            curLine = curLine.Substring(0, lineLength)
            'fill textbox2
            TextBox2.Text = TextBox2.Text + curLine + vbCrLf
            'clear out the space
            System.Runtime.InteropServices.Marshal.FreeHGlobal(stringPTR)
            stringPTR = IntPtr.Zero
        Next

    End Sub

See the pic

Estella commented: awesome.... :D +1
Neji commented: So hard....:twisted: +1
Jade_me commented: :confused: +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

No way...
Looking carefully on your toolbox.
See an attachment

Jx_Man 987 Nearly a Senior Poster Featured Poster

You're Welcome :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

i did'tn get what u want exactly...
this part code is how to get string from name, id and year.

Gen = Microsoft.VisualBasic.Right(ye, 2) + Microsoft.VisualBasic.Right(Id, 4) + Microsoft.VisualBasic.Right(Name, 3)

Right Function used to get some string from string as many as u want.
Right(SourceString (String), how much string to get (Int)).

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

HI Eko Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Any time

Jx_Man 987 Nearly a Senior Poster Featured Poster

Try This :

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Name, Id, ye, Gen As String

        Name = txtName.Text
        Ye = txtYearEnrolled.Text
        Id = txtIDNum.Text

        Gen = Microsoft.VisualBasic.Right(ye, 2) + Microsoft.VisualBasic.Right(Id, 4) + Microsoft.VisualBasic.Right(Name, 3)

        If Name = "" Then
            MsgBox("Name is empty")
        ElseIf ye = "" Then
            MsgBox("Year is empty")
        ElseIf Id = "" Then
            MsgBox("Id Number is empty")
        ElseIf txtYearEnrolled.TextLength > 4 Then
            MsgBox("Year Enrolled text box comtain more than 4 number")
        ElseIf Not IsNumeric(txtYearEnrolled.Text) Then
            MsgBox("Year Enrolled is not a numeric")
        Else
            MsgBox(Gen)
        End If
    End Sub
dnk commented: nice +1
Jx_Man 987 Nearly a Senior Poster Featured Poster
On Button Click Event :
Dim a As New Form2
a.Show
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Weclome to Daniweb Friend :)
Asal daerah mana?

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Shane...Weclome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Johny...Weclome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Weclome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Carrie...Weclome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Weclome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi loraswolf...Weclome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Weclome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Weclome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Weclome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Keith...Weclome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Weclome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Weclome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

try This :

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        CrystalReportViewer1.SelectionFormula = "Date({TableName.FieldName}) >= #" & dtStartDate.Value & "# And Date({TableName.FieldName}) <= #" & dtEndDate.Value & "#"
        CrystalReportViewer1.RefreshReport()

End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

Try this :

Private Sub ProcessView()
        Dim Prc As Process()
        Dim x As Integer

        Prc = Process.GetProcesses

        For x = 0 To UBound(Prc)
            ListBox1.Items.Add(Prc.GetValue(x))
        Next
End Sub
Sawamura commented: Great code +1
Jade_me commented: Good :P +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

actually i got a little confuse here. you want to insert all item in combobox or multiple selected?

Jx_Man 987 Nearly a Senior Poster Featured Poster

it causing your code just insert the selected item.
try to change cstr1 = ListBox1.Items.Item(i)
>> i = 1 --> its not starting with 1 but 0.
First item index is 0 not 1.

For i = 0 To ListBox1.Items.Count - 1
cstr1 = ListBox1.Items.Item(i)
strqry1 = "insert into trans(pid) values('" & cstr1 & "')"
'MessageBox.Show(strqry1)
'If ListBox1.GetSelected(i) = True Then
cmd.CommandText = strqry1
cmd.ExecuteNonQuery()
'End If
Next
MessageBox.Show("Records added")
Jx_Man 987 Nearly a Senior Poster Featured Poster

veena..., great.