Jx_Man 987 Nearly a Senior Poster Featured Poster

hi shouvik, its a nice code :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

try this following code :

'This project needs
' -a Command Button (Command1)
' -a CommonDialog (CommonDialog1)
' -a Label (Label1)
Private Const OF_READ = &H0&
Private Declare Function lOpen Lib "kernel32" Alias "_lopen" (ByVal lpPathName As String, ByVal iReadWrite As Long) As Long
Private Declare Function lclose Lib "kernel32" Alias "_lclose" (ByVal hFile As Long) As Long
Private Declare Function GetFileSize Lib "kernel32" (ByVal hFile As Long, lpFileSizeHigh As Long) As Long
Dim lpFSHigh As Long
Public Sub GetInfoF(FilePath As String)
    Dim Pointer As Long, sizeofthefile As Long
    Pointer = lOpen(FilePath, OF_READ)
    'size of the file
    sizeofthefile = GetFileSize(Pointer, lpFSHigh)
    Label1.Caption = sizeofthefile & " bytes"
    lclose Pointer
End Sub
Private Sub command1_Click()
    CommonDialog1.ShowOpen
    GetInfoF CommonDialog1.filename
End Sub
Private Sub Form_Load()
    With CommonDialog1
        .DialogTitle = "Select a file"
        .Filter = "All the files|*.*"
    End With
    Command1.Caption = "Select a file"
End Sub

Hope this helps...

dnk commented: you're the best ..... :) Thank you +1
Neji commented: helping +1
Jade_me commented: Through my mind +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

see this following code :
needed 4 check box, 1 textbox and 2 button.

Dim NamaFile As String
Private Sub Command1_Click()
Cmd.Filter = "All Files|*.*"
Cmd.DialogTitle = "Select Target"
Cmd.ShowOpen
NamaFile = Cmd.FileName
Text1.Text = NamaFile
End Sub

Private Sub Command2_Click()
Dim NilaiAttributes As Byte
If NamaFile <> "" Then
NilaiAttributes = (Check1.Value * 2) + (Check2.Value * 4) + _
                  (Check3.Value * 1) + (Check1.Value * 32)
SetAttr NamaFile, NilaiAttributes
MsgBox "Set attributes successfull", vbInformation, "Setting Attributes"
End If
End Sub

Private Sub Text1_Change()
NamaFile = Text1.Text
End Sub

Private Sub Text1_GotFocus()
NamaFile = Text1.Text
End Sub

Hope this helps...

Neji commented: thank you +1
dnk commented: Freaks +1
Naruse commented: good +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

you can also use media player control object.
add this from component.

on the form load

Me.WindowState = FormWindowState.Maximized
AxMediaPlayer1.FileName = "C:\movie1.avi"
AxMediaPlayer1.Play()
AxMediaPlayer1.ShowControls = False
AxMediaPlayer1.AllowChangeDisplaySize = False
AxMediaPlayer1.EnableContextMenu = False
AxMediaPlayer1.ClickToPlay = False
AxMediaPlayer1.SendKeyboardEvents = False
Me.Cursor.Hide()


At the end of stream event

Private Sub AxMediaPlayer1_EndOfStream(ByVal sender As Object, ByVal e As AxMediaPlayer._MediaPlayerEvents_EndOfStreamEvent) Handles AxMediaPlayer1.EndOfStream

AxMediaPlayer1.FileName = "C:\movie2.avi"
AxMediaPlayer1.Play()

End Sub

on the form unload , set back the cursor

Me.Cursor.Show()
Naruse commented: thanks again buddy +1
Neji commented: Great +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

use a Process, and simply "run" the file (If you happen to know the parameters for launching in fullscreen, then add that too).

Dim prc As New Process
        prc.StartInfo.FileName = "C:\mediafile.avi"
        prc.StartInfo.Arguments.Insert(0, "-Fullscreen")
        prc.Start()
Naruse commented: thx buddy +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

'This project needs a timer,Interval 1000 for normally

'In general section
Private Declare Function FlashWindow Lib "user32" (ByVal hwnd As Long, ByVal bInvert As Long) As Long
Const Invert = 1

Private Sub Timer1_Timer()
    'Flash the window
    FlashWindow Me.hwnd, Invert
End Sub
Jade_me commented: Great Code :) +1
Naruse commented: help me +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

try this followong code :

'This example requires two command buttons
Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Declare Function CopyIcon Lib "user32" (ByVal hIcon As Long) As Long
Private Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String) As Long
Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
Private Declare Function SetSystemCursor Lib "user32" (ByVal hcur As Long, ByVal id As Long) As Long
Private Declare Function GetCursor Lib "user32" () As Long
Private Const OCR_NORMAL As Long = 32512
Private currenthcurs As Long
Private tempcurs As Long
Private newhcurs As Long
Private Sub Command1_Click()
    Dim myDir As String
    Dim lDir As Long
    myDir = Space(255)
    currenthcurs = GetCursor()
    tempcurs = CopyIcon(currenthcurs)
    lDir = GetWindowsDirectory(myDir, 255)
    myDir = Left$(myDir, lDir) & "\cursors\banana.ani"
    newhcurs = LoadCursorFromFile(myDir)
    Call SetSystemCursor(newhcurs, OCR_NORMAL)
End Sub
Private Sub Command2_Click()
    Call SetSystemCursor(tempcurs, OCR_NORMAL)
End Sub

Hope this helps...

Estella commented: thx man +1
ITKnight commented: worked :) +1
Sawamura commented: :P +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

try this following code :

Private Declare Function OpenPrinter Lib "winspool.drv" Alias "OpenPrinterA" (ByVal pPrinterName As String, phPrinter As Long, pDefault As Any) As Long
Private Declare Function ClosePrinter Lib "winspool.drv" (ByVal hPrinter As Long) As Long
Private Declare Function PrinterProperties Lib "winspool.drv" (ByVal hwnd As Long, ByVal hPrinter As Long) As Long
Private Sub Form_Load()
     Dim hPrinter As Long
    OpenPrinter Printer.DeviceName, hPrinter, ByVal 0&
    PrinterProperties Me.hwnd, hPrinter
    ClosePrinter hPrinter
End Sub

hope this helps...

Naruse commented: never through.. +1
Sawamura commented: very helping me +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

you can do generally searching??
if u can, its a same technique.
put you search procedure in text change event. so when user input data on textbox it will searching others data.
but why u using first name as searching key??
how about if you have 2 same frist name in your database??why you didn't used their id?

Jx_Man 987 Nearly a Senior Poster Featured Poster

ok. happy coding friend :)
dont forget to mark this thread solved :D

Jx_Man 987 Nearly a Senior Poster Featured Poster

its ok friend.
are your question already solved?

Jx_Man 987 Nearly a Senior Poster Featured Poster

don't forget to give a feedback :)

Naruse commented: Great Feedback for your code friend.... +1
Neji commented: thx +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

try this following code :

Private Declare Function OpenPrinter Lib "winspool.drv" Alias "OpenPrinterA" (ByVal pPrinterName As String, phPrinter As Long, pDefault As Any) As Long
Private Declare Function ClosePrinter Lib "winspool.drv" (ByVal hPrinter As Long) As Long
Private Declare Function EnumJobs Lib "winspool.drv" Alias "EnumJobsA" (ByVal hPrinter As Long, ByVal FirstJob As Long, ByVal NoJobs As Long, ByVal Level As Long, pJob As Any, ByVal cdBuf As Long, pcbNeeded As Long, pcReturned As Long) As Long
Private Sub Form_Load()
   
    Dim hPrinter As Long, lNeeded As Long, lReturned As Long
    Dim lJobCount As Long
    OpenPrinter Printer.DeviceName, hPrinter, ByVal 0&
    EnumJobs hPrinter, 0, 99, 1, ByVal 0&, 0, lNeeded, lReturned
    If lNeeded > 0 Then
        ReDim byteJobsBuffer(lNeeded - 1) As Byte
        EnumJobs hPrinter, 0, 99, 1, byteJobsBuffer(0), lNeeded, lNeeded, lReturned
        If lReturned > 0 Then
            lJobCount = lReturned
        Else
            lJobCount = 0
        End If
    Else
        lJobCount = 0
    End If
    ClosePrinter hPrinter
    MsgBox "Jobs in printer queue: " + CStr(lJobCount), vbInformation
End Sub
Sawamura commented: great code and always helping... +1
Estella commented: wow +1
ITKnight commented: :confused: +1
november_pooh commented: yombex +1
Vega_Knight commented: :twisted: +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

try this following code :

Private Const SND_APPLICATION = &H80         '  look for application specific association
Private Const SND_ALIAS = &H10000     '  name is a WIN.INI [sounds] entry
Private Const SND_ALIAS_ID = &H110000    '  name is a WIN.INI [sounds] entry identifier
Private Const SND_ASYNC = &H1         '  play asynchronously
Private Const SND_FILENAME = &H20000     '  name is a file name
Private Const SND_LOOP = &H8         '  loop the sound until next sndPlaySound
Private Const SND_MEMORY = &H4         '  lpszSoundName points to a memory file
Private Const SND_NODEFAULT = &H2         '  silence not default, if sound not found
Private Const SND_NOSTOP = &H10        '  don't stop any currently playing sound
Private Const SND_NOWAIT = &H2000      '  don't wait if the driver is busy
Private Const SND_PURGE = &H40               '  purge non-static events for task
Private Const SND_RESOURCE = &H40004     '  name is a resource name or atom
Private Const SND_SYNC = &H0         '  play synchronously (default)
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long

Private Sub Form_Load()
    PlaySound "C:\WINDOWS\MEDIA\TADA.WAV", ByVal 0&, SND_FILENAME Or SND_ASYNC
   
End Sub
november_pooh commented: Really great code :) +1
ITKnight commented: hard to see +1
Jade_me commented: Good +1
Estella commented: Running Good +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

what version of vb that u using??
i guest you use vb6. if this right you post thread on wrong section, this section for vb.net you can post thread on vb 6 section but i still answer this thread...

first you must change button style on button properties from Standard to Graphical.
Style = Graphical
after that you can change back color of command button.
use this code to change color at runtime.

Command1.BackColor = vbBlue
Jx_Man 987 Nearly a Senior Poster Featured Poster

on combo box properties, set for DropDownStyle = DropDownList

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

yup, do as techtix and debasisdas said...
you need to exit the procedure or function first then go to handler.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Modules are a way to declare objects at one place and access them globally.

yes, absolutely like debasisdas. modules helps u to declared globally function, procedure, variable, etc. so you didn't have to declare them again in every form.

Jx_Man 987 Nearly a Senior Poster Featured Poster

I know vb.net not vb

vb.net is vb.

I want to ask is there so much difference b/w vb & Vb.Net.

not much different, you will find about encapsulation in vb.net, you cannot access class directly in .net.
others think is same, if you good in vb 6 there are none problem to migrate.

Jx_Man 987 Nearly a Senior Poster Featured Poster

i think this code is alright.

Jx_Man 987 Nearly a Senior Poster Featured Poster

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

dnk commented: thanks again.... +1
Vega_Knight commented: cookies +1
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

no many changes in .net. if u good in vb 6, you will get easy way to learn vb.net. vb 6 is structural whereas vb.net is OOP. So to learn vb.net you must to know what is object oriented.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

open connection is required to connect.

Jx_Man 987 Nearly a Senior Poster Featured Poster

needed a combobox to display,textbox for input and button.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ComboBox1.Items.Add(TextBox1.Text)
    End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

thanks neji...

Jx_Man 987 Nearly a Senior Poster Featured Poster

Eating and listening to reggae music.

yes eating....

Jx_Man 987 Nearly a Senior Poster Featured Poster

you're welcome friend...
don't forger to mark this thread solved :)

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
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim mySound As New Sound("\windows\alarm1.wav")

mySound.Play()

End Sub
End Class

Public Class Sound

Private m_soundBytes() As Byte

Private m_fileName As String

Public Declare Function WCE_PlaySound Lib "CoreDll.dll" Alias "PlaySound" (ByVal szSound As String, ByVal hMod As IntPtr, ByVal flags As Integer) As Integer

Public Declare Function WCE_PlaySoundBytes Lib "CoreDll.dll" Alias "PlaySound" (ByVal szSound() As Byte, ByVal hMod As IntPtr, ByVal flags As Integer) As Integer

Private Enum Flags

SND_SYNC = &H0 ' play synchronously (default)

SND_ASYNC = &H1 ' play asynchronously

SND_NODEFAULT = &H2 ' silence (!default) if sound not found

SND_MEMORY = &H4 ' pszSound points to a memory file

SND_LOOP = &H8 ' loop the sound until next sndPlaySound

SND_NOSTOP = &H10 ' don't stop any currently playing sound

SND_NOWAIT = &H2000 ' don't wait if the driver is busy

SND_ALIAS = &H10000 ' name is a registry alias

SND_ALIAS_ID = &H110000 ' alias is a predefined ID

SND_FILENAME = &H20000 ' name is file name

SND_RESOURCE = &H40004 ' name is resource name or atom

End Enum

' Construct the Sound object to play sound data from the specified file.

Public Sub New(ByVal fileName As String)

m_fileName = fileName

End Sub

' Construct the Sound object to play sound data from the specified stream.

Public Sub New(ByVal stream As System.IO.Stream)

' read the data from the stream

m_soundBytes = New Byte(stream.Length) {}

stream.Read(m_soundBytes, 0, Fix(stream.Length))

End Sub 'New

' Play the sound

Public Sub …
Jx_Man 987 Nearly a Senior Poster Featured Poster

well i never do this in smart device...

Jx_Man 987 Nearly a Senior Poster Featured Poster

Playing Basketball
swimming
read books
Guitar & keyboard
watching Movies (korean movies)
Eat :D

Jx_Man 987 Nearly a Senior Poster Featured Poster

this for windows application.
i repost the program.

Jx_Man 987 Nearly a Senior Poster Featured Poster

reference missing maybe..

Jx_Man 987 Nearly a Senior Poster Featured Poster

what u means cant open?
cant to open attachment file or wave (.wav) file?

Jx_Man 987 Nearly a Senior Poster Featured Poster

declare even and odd as integer and value to accomodate input (get).
to insert (put) number you can use text box or inputbox.

Jx_Man 987 Nearly a Senior Poster Featured Poster
Select * from Table1 a left join Table2 b on (a.id = b.id) where a.id <> '1'
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

i m glad to share :)

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

Correction :

Common_Features.Addendum1.Text = (CDbl(Common_Features.Addendum.Text) * 25.4).ToString

just set option strict to off. you make this more harder.

Jx_Man 987 Nearly a Senior Poster Featured Poster

set strict on to off. it will make error. why you want to set it on??

Jx_Man 987 Nearly a Senior Poster Featured Poster

for an attachment in this thread??i try download it and none file corrupted. are you sure??

Jx_Man 987 Nearly a Senior Poster Featured Poster

i post the program, try it.

Jx_Man 987 Nearly a Senior Poster Featured Poster

are you have already solved them??

Jx_Man 987 Nearly a Senior Poster Featured Poster

oh. its already solved. great. i think that i must migrate from .net 2003 to higher. more controls not included here.