Jx_Man 987 Nearly a Senior Poster Featured Poster

try this following code, this code didn't allowed you to input any special character just numbers and letters:

Private Sub Text1_KeyPress(KeyAscii As Integer)
    Select Case KeyAscii
        Case 65 To 90, 48 To 57, 8 ' A-Z, 0-9 and backspace
        'Let these key codes pass through
        Case 97 To 122, 8 'a-z and backspace
        'Let these key codes pass through
        Case Else
        'All others get trapped
        KeyAscii = 0 ' set ascii 0 to trap others input
    End Select
End Sub
Neji commented: simple but excellent +1
Vega_Knight commented: great +1
Naruse commented: :D SIIIIIIIIPpppp +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

try to using ascii then trap when key press.

Jx_Man 987 Nearly a Senior Poster Featured Poster

oh, and don't forget to set MultiSelect = simple or extend on listbox properties. so item can be selected more than one. ok :)

dnk commented: nice one +1
Neji commented: Always Help :P +1
Vega_Knight commented: Good +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

try this following code :

Private Sub Form_Load()
Dim i As Integer
For i = 0 To 10
    List1.AddItem (i)
Next
End Sub

Private Sub List1_KeyDown(KeyCode As Integer, Shift As Integer)
Dim intIndex As Integer
    If Shift = 2 Then
        If KeyCode = vbKeyA Then
            For intIndex = 0 To List1.ListCount - 1
                List1.Selected(intIndex) = True
            Next
        End If
    End If
End Sub

Hope this helps...

Estella commented: sings good +1
Sawamura commented: nice one :) +1
Neji commented: excellent +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

you're welcome :)

Estella commented: helpfull person +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

ha...3x, google is great searcher machine...:)

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

well great...
happy coding friend :)

ITKnight commented: thanks for direction +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

> what require if someone want to be a team colleague, featured poster,moderator, etc ??

Don't think a lot about it. If you are good enough, these things will anyways come to you sooner or later. Just keep helping out people and above all, have fun. :-)

yes..absolutely agree. the point in this forums is helping out people who needs help. :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

reference missing maybe..

Jx_Man 987 Nearly a Senior Poster Featured Poster
Sawamura commented: savior :) +1
Jade_me commented: thanks for the links :) +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Thando...
i'll post the program to you.
i guest you don't load movies before.
see the program, and press load movies button to load flash file and play.

dnk commented: Thanks man +1
november_pooh commented: :) +1
Jx_Man 987 Nearly a Senior Poster Featured Poster
this.Dispose(false);
majestic0110 commented: did not know that! useful to know though! +1
Vega_Knight commented: right +1
Jade_me commented: most helps +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi sammy...
please don't do like this again, you can post on previous post if you want to do like this.
Ok. i repost again the files.

Neji commented: once again for your great code :) +1
Sawamura commented: Perfectly +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

txtStartUp is path of startup folder
YourExeNameOnStartUpFolder.exe is your exe file name when it copied into startup folder.
put this following code into your current event :

FileCopy App.EXEName & ".exe", txtStartupPath & "\YourExeNameOnStartUpFolder.exe"
msgbox "Copying Success"

Hope this helps...

Estella commented: nice one +1
november_pooh commented: always help with great code :) +1
ITKnight commented: Good +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

see this following code :

Dim mShell
Set mShell = CreateObject("WScript.Shell")
txtPath  = mShell.SpecialFolders("Startup")

Hope this helps..

november_pooh commented: thank you very much +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

add timer, set interval = 100 on interval properties.

Private Sub tmrCek_Timer()
On Error Resume Next
    Call List_Process
End Sub

hope this helps..

Vega_Knight commented: great :) +1
Neji commented: so beatifull +1
november_pooh commented: ??help to learn +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

use this follwing code :
needed two listbox named list1 and list2

Const TH32CS_SNAPHEAPLIST = &H1
Const TH32CS_SNAPPROCESS = &H2
Const TH32CS_SNAPTHREAD = &H4
Const TH32CS_SNAPMODULE = &H8
Const TH32CS_SNAPALL = (TH32CS_SNAPHEAPLIST Or TH32CS_SNAPPROCESS Or TH32CS_SNAPTHREAD Or TH32CS_SNAPMODULE)
Const TH32CS_INHERIT = &H80000000
Const MAX_PATH As Integer = 260
Private Type PROCESSENTRY32
    dwSize As Long
    cntUsage As Long
    th32ProcessID As Long
    th32DefaultHeapID As Long
    th32ModuleID As Long
    cntThreads As Long
    th32ParentProcessID As Long
    pcPriClassBase As Long
    dwFlags As Long
    szExeFile As String * MAX_PATH
End Type
Private Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal lFlags As Long, ByVal lProcessID As Long) As Long
Private Declare Function Process32First Lib "kernel32" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Function Process32Next Lib "kernel32" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Function OpenProcess Lib "kernel32.dll" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function TerminateProcess Lib "kernel32.dll" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
Private Declare Function CloseHandle Lib "kernel32.dll" (ByVal hHandle As Long) As Long
Private Const PROCESS_ALL_ACCESS = &H1F0FFF
'Enum the path
Private Const PROCESS_QUERY_INFORMATION As Long = &H400
Private Const PROCESS_VM_READ = &H10
Private Declare Function EnumProcessModules Lib "psapi.dll" (ByVal hProcess As Long, ByRef lphModule As Long, ByVal cb As Long, ByRef cbNeeded As Long) As Long
Private Declare Function GetModuleFileNameExA Lib "psapi.dll" (ByVal hProcess As Long, ByVal hModule As Long, ByVal ModuleName As String, ByVal nSize As Long) As Long


Private …
ITKnight commented: thanks :) +1
Estella commented: wow, Great Code :D +1
Sawamura commented: Great Code :) +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

use this following code :

Private Const MAX_COMPUTERNAME_LENGTH As Long = 31
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Private Sub GetCompName()
Dim dwLen As Long
    Dim strString As String
    'Create a buffer
    dwLen = MAX_COMPUTERNAME_LENGTH + 1
    strString = String(dwLen, "X")
    'Get the computer name
    GetComputerName strString, dwLen
    'get only the actual data
    strString = Left(strString, dwLen)
    'Show the computer name
    MsgBox "WELCOME " & strString
   
End Sub

Private Sub Form_Load()
GetCompName
End Sub
Naruse commented: this is very Great Code. Works like charm :). thanks buddy +1
Neji commented: help me too +1
Jx_Man 987 Nearly a Senior Poster Featured Poster
If IsDate(textDate.Text) = True Then
            MsgBox("correct date")
        Else
            MsgBox("input correct date")
        End If
ITKnight commented: usefull +1
dnk commented: great +1
Jx_Man 987 Nearly a Senior Poster Featured Poster
SELECT * FROM TableName WHERE ColumnName like '%" & textBox1.Text & "%'
Naruse commented: got it +1
Jx_Man 987 Nearly a Senior Poster Featured Poster
select a.id, a.colname, b.colname from Table1 a join Table2 a on (a.id=b.id) where a.id = '1' order by a.id asc
Naruse commented: thanks +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

hi pooh...Welcome to Daniweb friend :)

november_pooh commented: Thanks +0
Jx_Man 987 Nearly a Senior Poster Featured Poster

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

dnk commented: helpfull people +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

try this following code :

{********************************************
  * This Procedure to Sort element vektor *
  * Procedure ATUR to organize an element position *
 ********************************************}
 procedure QUICKSORT (var A : Larik;
                          Awal, Akhir : integer);
 var I,J : integer;

 procedure ATUR;

 begin
 
   I := Aw + 1;
   J := Ak;

 
   while A[I] < A[Aw] do inc(I);


   while A[J] > A[Aw] do dec(J);
   while I < J do

     begin
       TUKARKAN(A[I],A[J]);
       while A[I] < A[Aw] do inc(I); {*To Right*}
       while A[J] > A[Aw] do dec(J); {* TO Left*}
     end;
   TUKARKAN(A[Aw],A[J])
 end;              
 
 begin
   if Aw < Ak then
      begin
        ATUR;
        QUICKSORT(A,Aw,J-1);
        QUICKSORT(A,J+1,Ak)
      end
 end;

Hope this helps...

Jade_me commented: great :) +1
Naruse commented: worked +1
Vega_Knight commented: :) +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

you must to declare what is SW_SHOWNORMAL.

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Const SW_HIDE = 0
Private Const SW_MAXIMIZE = 3
Private Const SW_MINIMIZE = 6
Private Const SW_RESTORE = 9
Private Const SW_SHOW = 5
Private Const SW_SHOWDEFAULT = 10
Private Const SW_SHOWMAXIMIZED = 3
Private Const SW_SHOWMINIMIZED = 2
Private Const SW_SHOWMINNOACTIVE = 7
Private Const SW_SHOWNA = 8
Private Const SW_SHOWNOACTIVATE = 4
Private Const SW_SHOWNORMAL = 1

Private Const ERROR_FILE_NOT_FOUND = 2&
Private Const ERROR_PATH_NOT_FOUND = 3&
Private Const ERROR_BAD_FORMAT = 11&
Private Const SE_ERR_ACCESSDENIED = 5            '  access denied
Private Const SE_ERR_ASSOCINCOMPLETE = 27
Private Const SE_ERR_DDEBUSY = 30
Private Const SE_ERR_DDEFAIL = 29
Private Const SE_ERR_DDETIMEOUT = 28
Private Const SE_ERR_DLLNOTFOUND = 32
Private Const SE_ERR_NOASSOC = 31
Private Const SE_ERR_OOM = 8                     '  out of memory
Private Const SE_ERR_SHARE = 26

Private Const STYLE_NORMAL = 11
Sawamura commented: thanks for declaration +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

i was modified your code, i add two event handling in keypress event :

Public Class Form1
'This code not allowed you entered numeric input
Private Sub txtFirstName_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtFirstName.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
            'space accepted
            If (Microsoft.VisualBasic.Asc(e.KeyChar) <> 32) Then
                e.Handled = True
            End If
        End If
        If (Microsoft.VisualBasic.Asc(e.KeyChar) = 8) _
       Or (Microsoft.VisualBasic.Asc(e.KeyChar) = 44) _
       Or (Microsoft.VisualBasic.Asc(e.KeyChar) = 45) _
       Or (Microsoft.VisualBasic.Asc(e.KeyChar) = 46) Then
            e.Handled = False
        End If
    End Sub
	
'This code not allowed you entered numeric input
Private Sub txtLastName_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtLastName.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
            'space accepted
            If (Microsoft.VisualBasic.Asc(e.KeyChar) <> 32) Then
                e.Handled = True
            End If
        End If
        If (Microsoft.VisualBasic.Asc(e.KeyChar) = 8) _
       Or (Microsoft.VisualBasic.Asc(e.KeyChar) = 44) _
       Or (Microsoft.VisualBasic.Asc(e.KeyChar) = 45) _
       Or (Microsoft.VisualBasic.Asc(e.KeyChar) = 46) Then
            e.Handled = False
        End If
    End Sub
	
Private Sub btnCalcCost_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalcCost.Click
        Dim numMonths As Integer
        Dim decTotalCost As Decimal
        Dim memCost As Integer
        Dim singleMem As Decimal = 38D
        Dim FamilyMem As Decimal = 58D
        Dim seniorMem As Decimal = 27D



        If IsNumeric(Me.txtNumberOfMon.Text) Then numMonths = Convert.ToInt16(Me.txtNumberOfMon.Text)

		
		If txtfirstName.text = "" Or txtLastName.text = "" Then
            MessageBox.Show("Error")        
		else
			If numMonths > 0 Then
				If Me.radSingleMem.Checked Then
					memCost = singleMem …
shannonpaul commented: We need more programmers Jx_man. Always willing to help someone that is eager to learn. +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

you're welcome friend :)

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

please see my code :
there are something wrong?how i can check if stack is empty??
NB : isi = content of stack
atas = top of stack
tumpukan is stack

function POP (var T : Tumpukan) : integer;
 begin
        POP := T.Isi[T.Atas];
        T.Atas := dec[T.Atas];
 end;

i was modified your code and add a some code :
i use your initial code...

function POP (var T : Tumpukan) : integer;

 {*this function to check stack is empty or not*}
 function Empty(var T : Tumpukan): boolean;

 begin
   Empty := (T.Atas = 0)
 end;      

 begin
   if Empty(T) then
      POP := 0
   else
      begin
        POP := T.Isi[T.Atas];
        T.Atas := dec[T.Atas];
      end;
 end;

Ok. Hope this helps....

dnk commented: helping much, thanks for empty function. you are really good guy with smart code :) +1
Vega_Knight commented: hei, i get this one too +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

try this following code :

program Reverse_String;

 uses crt;

 const Elemen = 255;   {* Max character *}

 type S255     = string[Elemen];
      Stack = record
                   Input  : S255;
                   Tops : 0..Elemen
                 end;

 var  T       : Stack;  
      I       : integer;   
      StringInput : S255;     

  procedure AWALAN (var T : Stack);

  begin
    T.Tops := 0
  end;        

 
 procedure PUSH (var T : Stack; X : char);

 begin
   T.Tops := T.Tops + 1;
   T.Input[T.Tops] := X
 end;          {* PUSH *}

  function POP (var T : Stack) : char;

  begin
    POP := T.Input[T.Tops];
    T.Tops := T.Tops - 1
  end;         {* POP *}
 {*****************
  * Main program *
  *****************}
  begin
    clrscr;
    Awalan(T);
    writeln('Stack To reverse string');
    writeln('-------------------------------');
    writeln;

    {* String that it want to reverse*}
    write('Input any kind of Strings: ');
    readln(StringInput);

    clrscr;
    writeln('Original Strings:'); writeln(StringInput);

    writeln;writeln('Strings After Reverse:');

    {* push Input strings into Stack *}
    for I := 1 to length(StringInput) do
      PUSH (T, StringInput[I]);

    {* pop Stack Input until Input String reverse*}
    for I := 1 to length(StringInput) do
      write(POP(T));

    writeln
 end.
Jade_me commented: what a wonderful code +1
Naruse commented: nice one... +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

see this code :

Dim sql As String
Private Sub ViewData()
    Set rs = New ADODB.Recordset
        rs.CursorType = adOpenDynamic
        rs.LockType = adLockOptimistic
        rs.Open "SELECT * FROM Login Where UserID = '" & txtUserId.Text & "' AND Password = '" & txtPasw.Text & "'", Conn, , , adCmdText
       
    Set DataGrid1.DataSource = rs
    DataGrid1.Columns(0).Width = 2000
    DataGrid1.Columns(1).Width = 2000
   
    DataGrid1.AllowAddNew = False
    DataGrid1.AllowArrows = True
    DataGrid1.AllowDelete = False
    DataGrid1.AllowUpdate = False
End Sub
Private Sub ViewData2()
    Set rs = New ADODB.Recordset
        rs.CursorType = adOpenDynamic
        rs.LockType = adLockOptimistic
        rs.Open "select * from Login ", Conn
       
    Set DataGrid1.DataSource = rs
    'DataGrid1.Columns(0).Width = 2000
    'DataGrid1.Columns(1).Width = 2000
   
    DataGrid1.AllowAddNew = False
    DataGrid1.AllowArrows = True
    DataGrid1.AllowDelete = False
    DataGrid1.AllowUpdate = False
End Sub
Private Sub btnView_Click()
Access_Connector
Call ViewData
End Sub

Private Sub Form_Load()
Access_Connector
ViewData2
End Sub

ok. Hope this Helps...
don't forget to give feedback...

Sawamura commented: awesome +1
Jade_me commented: great +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

you're welcome

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi....Jx_Man

Thanks yeah for your reply
but if u dont mind...can u guide me with some sample code
actually i dont know about vb.net much...

Thanks

this code in form 1

Public Shared temp As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim i As Integer
For i = 1 To 10
ListView1.Items.Add(i)
Next i
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim frm2 As New Form2
    frm2.Show()
End Sub

Private Sub ListView1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.Click
    temp = ListView1.SelectedItems(0).Text
    Label1.Text = ListView1.SelectedItems(0).Text
End Sub

this code in form 2 :

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Text = Form1.temp
End Sub

This an attachment of my code
ListView - Daniweb.zip

Ok. Hope this helps..

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

see this attachment :

Change Font.zip

Hope this helps...
PS: don't remove author name n comment

Estella commented: Great code +1
dnk commented: grab this wonderful code +1
ITKnight commented: good example :) +1
Neji commented: Thanks +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

see this code :

function FIBO(N : integer) : integer; 

 begin 
   if (N = 1) or (N = 2) then 
      FIBO := 1 
   else 
      FIBO(N) := FIBO(N - 1) + FIBO(N - 2) 
 end;

hope this helps...

Jade_me commented: thank you +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

ok. see this example program :

Get All User.zip

Hope this helps.
don't forget to give feedback.

Neji commented: Great Program :D +1
Naruse commented: helps me too +1
november_pooh commented: Good friend +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

you're welcome. its ok, everybody can make mistake. happy coding friend :)
all for the best.

Jx_Man 987 Nearly a Senior Poster Featured Poster

that you means every user included default user that it created by windows??

Neji commented: help me much +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

i think you forget to set full = false, just it.
add this code after else :

begin
        Full := false;
        T.Top := inc(T.Top);
        T.Contain[T.Top] := X
      end

ok hope this helps..

ITKnight commented: :D +1
Vega_Knight commented: upss..i forgot. thanks for the great helps..want to see your help again +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

see this example :
i write this code in pascal

[ATTACH]5318[/ATTACH]

hope this helps..

Jx_Man 987 Nearly a Senior Poster Featured Poster

see this example :
i write this code in pascal

Array.zip

hope this helps..

Vega_Knight commented: Help me much +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

see this palindrome program :

Palindrome.zip

don't forget to give feedback.

Sawamura commented: great +1
Neji commented: peace of code +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

u can use a same logic to read other hardware info.

Naruse commented: sight +4
Jx_Man 987 Nearly a Senior Poster Featured Poster

you're welcome and you right this a great site.

happy coding.

Naruse commented: nice guy +1
Neji commented: peacefull code man +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi ChristosK...
Sorry i must to convert this program into vb.net cause it build in c# before. sorry if this program not perfect. u can develop this program to read other hardware info. look into link which i given to you yesterday, that link will help u much.

Daniweb.zip

OK. Hope This helps.

Jx_Man 987 Nearly a Senior Poster Featured Poster

as james said you should to using wmi (Windows Management Instrumentation).
i have a simple prog to read motherboard model but i m do with vb.net. if you want, i'll post it for you.

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

as estella said it using winmm.dll
see this prog :

CD ROOM Access.zip

OK. Hope This Helps...

Sawamura commented: excelent +1
Estella commented: hmm... great, awesome code. always helping +1
dnk commented: =) +1
november_pooh commented: Good :) +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

use this code to get upper result

CompName = CompName.ToUpper
UseName = UseName.ToUpper
Jade_me commented: thx to direct me +1
Jx_Man 987 Nearly a Senior Poster Featured Poster
CompName = System.Environment.MachineName.ToString
UseName = System.Environment.UserName.ToString
Naruse commented: Usefull. thx +1
Sawamura commented: easy code for beginer +1
Vega_Knight commented: wow so easy..;) +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

set database source on data1 properties. browse a current path of database.

Jx_Man 987 Nearly a Senior Poster Featured Poster

check this prog :

Database With Data Control.zip

Hope This Helps...
Happy Coding :)

dnk commented: thanks... very helpfull +1
Vega_Knight commented: fine start for me +1
Estella commented: this a good example. thanks jx_man +1
Sawamura commented: wonderful code +1