Jx_Man 987 Nearly a Senior Poster Featured Poster

make a procedure to select the last number on tran_head and add it with 1..that a autonumber logic..

Jx_Man 987 Nearly a Senior Poster Featured Poster

install .net framework first on client pc

Jx_Man 987 Nearly a Senior Poster Featured Poster
textunit.SelStart = Len(textunit.Text)/2
Jx_Man 987 Nearly a Senior Poster Featured Poster

you simply can not...a msgbox is a modal window that uses the standard windows system font.
you can manipulate it with use form as your message box..

Jx_Man 987 Nearly a Senior Poster Featured Poster

This code to save, Edit and delete data in VB.Net using SQLServer as backend. this code is continuance from my previous post "Show Data in DataGrid with VB.Net 2003 and SQLServer 2000". so i didn't write code how to connect SQLServer 2000 with VB.Net 2003 cause this already in there.
Please see and read a comment on code carefully so this code can implement goods.

Jx_Man 987 Nearly a Senior Poster Featured Poster

This is code for Encrypt and Decrypt. this a simple logic of encryption. Please leave comment or feedback if this code helps you. Thanks. Jery. :)
the encrypt function place in a module.
This Code needed :
1 Module
1 combo box (For input before encryption) text1 in this program
2 label (For encryption result and encryption reading) --> label1 and label 3 in this program

Jx_Man 987 Nearly a Senior Poster Featured Poster

This Code is easy way to load / show data in Datagrid. This Code write in vb.net 2003 and use sqlserver 2000 as database. I use module to connected VB.Net with SqlServer 2000. so the function to connected can be use in every form in this project.

Jx_Man 987 Nearly a Senior Poster Featured Poster

use condition on your select statment.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Thx For sharing... :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

very good. Would you like to share with us how to do it, so if other members get the same problem they can solved it.
And don't forget to mark this thread as solved..
Thanks :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

on datagrid double click event, get data on selected then show it on main form.

Jx_Man 987 Nearly a Senior Poster Featured Poster

write this on the top of codes

Imports System.Data.Odbc
Sawamura commented: jaauh +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi my name is Hussain Ahmed Chowdhury. I need your software & report. Please help me...
Here my id hacbd86@gmail.com

do it by yourself!!!

Jx_Man 987 Nearly a Senior Poster Featured Poster

You're Welcome :)

Neji commented: yes +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

1. Yes, its for input name.
2. Yes, sohel used to know input name and show in msgbox. (same for jewel)
3. Yes, it connected.
First, sohel in CheckWinner function parameter and sohel in global declaration is different.
Sohel in checkwinner paramete got player name from sohel in global variable (from inputbox).
So you can change sohel paramete in checkwinner function with other name variable, its just a variable name. Same too for jewel.
Ex : sohel is fox and jewel is xof

Public Function CheckWinner(T1 As TextBox, T2 As TextBox, T3 As TextBox, fox As String, xof As String)
If (T1.BackColor = vbBlue) And (T2.BackColor = vbBlue) And (T3.BackColor = vbBlue) Then
    MsgBox "" & xof & "  win", vbOKOnly, "win"
    SetBackColor
End If
If (T1.BackColor = vbRed) And (T2.BackColor = vbRed) And (T3.BackColor = vbRed) Then
    MsgBox "" & fox & "  win", vbOKOnly, "win"
    SetBackColor
End If
End Function

But its still same when u call CheckWinner function (i mean the way to call).
Ex :

...
....
Call CheckWinner(Text1, Text2, Text3, sohel, jewel) ' sohel & jewel from global var
....
...

here, sohel and jewel from global variable for input name in the option button.

abu taher commented: thanks. I realy get a lot of help. +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

>> Call CheckWinner(Text1, Text2, Text3)
here text1 mean t1 what was write in the module?
Yes. text1 will assigned with T1, then T1 used to check back color of textbox.

>> Public Sub SetBackColor()
For Each controlx In Form1.Controls
If TypeOf controlx Is TextBox Then
controlx.BackColor = vbWhite
Next controlx
End Sub.
please explain under few lines. what is controlx?

Controlx is a Control (Form1.controls). It can be any controls (textbox, button,label, etc).
But in this function i check controlx as textbox.
See this line : If TypeOf controlx Is TextBox so i check on the form1, if i find text box control in form1 then back color of textbox become white. So you didn't have to spending times for writing code to change all textbox back color one by one, but you can do it with check control type. If control type is textbox then u can change any properties of text box (backcolor in this case).

You can change controlx type (ex. button) :

For Each controlx In Form1.Controls
If TypeOf controlx Is CommandButton Then
controlx.BackColor = vbWhite
Next controlx
End Sub

this code means for every controlx, if controlx is button then back color of button become white.

Sawamura commented: You work to hard for this :) +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

I already see your project.
You write too many if statement (make me dizzy) and it redundant.
Actually you can simplify your if statement become a function. so you just call function in each textbox checking.
I modified your program with added a module. In this module i put a function to check who is won and function to make all backcolor of textbox is white.

Module using to declare function/procedure or variable. with module you can call each function or variable from any form.

NB : you can make this program more simplify again. just see redundant if statement and exchange it become a function/procedure.

Jade_me commented: you make this program so simply.... +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

SELECT * FROM participants WHERE Date between DTPicker1.Value and DTPicker2.Value

abu taher commented: thanks a lot. +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Actually i didn't agree with your if statement :
If you want to know check box is checked or not then use Checked function :
Try this :

Private Sub chkboxLadiesShoes_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkboxLadiesShoes.CheckedChanged
        Dim ladiesShoes As String = "Ladies Shoes"

        If chkboxLadiesShoes.Checked = True Then
            lstDisplay.Items.Add(ladiesShoes)
        ElseIf chkboxLadiesShoes.Checked = False Then
            lstDisplay.Items.Clear()
        End If
End Sub
bpacheco1227 commented: a great help +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

Try This code :

Dim path as String
path = "D:\Test\Music.wav"
My.Computer.Audio.Play(path)
Estella commented: how about mp3 file? +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Try this

Microsoft.VisualBasic.Right("Daniweb",3)
november_pooh commented: simple code but great +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Use timer to make delay and progress bar.
so, draw a timer and progress bar then add this following code :

Private Sub WelcomeScreen_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Enabled = True
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        ProgressBar1.Value += 2

        If ProgressBar1.Value = 98 Then
            Dim obj As New Form2
            obj.ShowDialog() 'open form2
        End If
        If ProgressBar1.Value = 100 Then
            Timer1.Dispose()
            Me.Visible = False
        End If
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

Add on click event (you can find combo box filled with sstab event on the top of code window)
This following code will make u can't open other tabs without fill textbox 1 (text1).

Private Sub SSTab1_Click(PreviousTab As Integer)
If Text1.Text = "" Then ' add as u needed
    SSTab1.Tab = 0
End If
End Sub
ITKnight commented: :twister: +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

using between or operator ">" and "<".

dnk commented: Right... +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Then post your code, it more help.
and which line of error...

Jx_Man 987 Nearly a Senior Poster Featured Poster
sql = "INSERT INTO Department(Department_ID,Department_name)VALUES('" & deptid & "','" & Text2.Text & "' )"
dnk commented: always help +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Post your code.

Jx_Man 987 Nearly a Senior Poster Featured Poster
Vega_Knight commented: wow, helped site :) +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Well, this morning i copying new font and there are no error when i used in vb.

Naruse commented: what??? +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

>> the connections strings which i used in vs.net2003 isnot working here
Maybe a little mistake. Just post your connection string. Btw visit this site

Neji commented: thanks for the site... +1
Naruse commented: nice site ;D +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

you can add reputation on Dnx, just click on Add to Dnx's Reputation and fill the message.

Jx_Man 987 Nearly a Senior Poster Featured Poster
Dim temp, quantity As Double      
Console.Write("How many liters (only whole liters please ) ? ")
temp = Console.ReadLine()
quantity = Double.Parse(temp)
Jx_Man 987 Nearly a Senior Poster Featured Poster

Try This :

Public Sub GenerateNotaId()
        Dim myReader As SqlDataReader
        conn = GetConnect()
        conn.Open()
        Dim temp As String
        Try
            Dim sql As String = "SELECT MAX(IDNOTA) AS 'KODE' FROM Nota "
            Dim comm As SqlCommand = New SqlCommand(sql, conn)
            myReader = comm.ExecuteReader
            If myReader.HasRows Then
                While myReader.Read()
                    temp = myReader.Item("KODE") + 1
                End While
            End If
            myReader.Close()
        Catch ex As Exception

        End Try
        conn.Close()
        If temp = 0 Then
            txtNoNota.Text = 1
        Else
            txtNoNota.Text = String.Concat(temp)
        End If
End Sub

Generate will shown in txtNoNota

Estella commented: Siip, this what i looking for :P +1
ITKnight commented: Great Code +1
Naruse commented: not bad +2
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
Jade_me commented: this for c#??? +1
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

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

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
Private Sub Timer1_Timer()
ProgressBar1.Value = ProgressBar1.Value + 5
    If ProgressBar1.Value = 100 Then
        MDIForm1.Show
        Timer1.Enabled = False
        Unload Me
    End If
End Sub

Set Timer Interval on Properties = 70.

Jx_Man 987 Nearly a Senior Poster Featured Poster
dim string1 as string

string1 = gridview1.rows(row#).cells(cell#).text.tostring
Vega_Knight commented: thanks...its worked to me +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

>>There are another ways to hide drive without using API function?
Yes, with add key on your registry...
Add module :

Public Sub CreateKey(ayun As String, Value As String)
Dim b As Object
On Error Resume Next
Set b = CreateObject("wscript.shell")
b.RegWrite ayun, Value
End Sub

Public Sub CreateIntegerKey(ayun As String, Value As Integer)
Dim b As Object
On Error Resume Next
Set b = CreateObject("wscript.shell")
b.RegWrite ayun, Value, "REG_DWORD"

End Sub
'Delete registry key
Public Sub DeleteKey(Value As String)
Dim b As Object
On Error Resume Next
Set b = CreateObject("Wscript.Shell")
b.RegDelete Value
End Sub

This following code will hide drive D:\

Private Sub Command1_Click()
CreateIntegerKey "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Nodrives", 8
End Sub

Restart or logoff to know it works or not
This is value of key :
C = 4
D = 8
E = 16
F = 32
...
C and D = 4 + 8 = 12
C and E = 4 + 16 = 20
D and E = 8 + 16 = 24
....
C and D and E = 4 + 8 + 16 = 28
....

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

try this following code to hide folder

Private Sub Form_Load()
Dim FileSys, FolderPath
Set FileSys = CreateObject("Scripting.FileSystemObject")
Set FolderPath = FileSys.GetFolder("D:\test")
FolderPath.Attributes = -1
End Sub

to unhide set attributes = 0

Estella commented: Wonderful code +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

You're Welcome...
Happy coding :)

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

Call Decript function before check. ......WHERE Decript(psw)=' " & text1.text & " ' Or
You can encript inputed pasw before check ......WHERE psw=' " & Encript(text1.text) & " '

Jx_Man 987 Nearly a Senior Poster Featured Poster
Private Sub ListView_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        
        Dim i As Integer
        Dim lvitem As ListViewItem
        For i = 1 To 5
            lvitem = ListView1.Items.Add("1")
            lvitem.SubItems.Add("sonia")
            lvitem.Checked = True
        Next 
End Sub
dnk commented: worked +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

SS Tab is a control on Component (Ctrl + T or Project ->Component).

dnk commented: pleasee details +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

First you must to know the pattern of prime number then u can write the code.
see wikipedia and FactMonster

Vega_Knight commented: linkers +1
Naruse commented: N/A +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

if successfully then give a message.