Jx_Man 987 Nearly a Senior Poster Featured Poster

i think for sharing controls...

Jx_Man 987 Nearly a Senior Poster Featured Poster

don't post thread like this again...
use your previous thread, don't make this forum full with your multiple thread. you just ask again in same post.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Rodney 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

in any even :

Private Sub Form_Load()
App.TaskVisible = False
App.Title = ""
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

explain more clearly

Jx_Man 987 Nearly a Senior Poster Featured Poster

You havent even tried spell checking! Go read the books before you post your homework.

don't added other problem. its just a little mistaken in spell.
ok. happy coding :)

Jx_Man 987 Nearly a Senior Poster Featured Poster
Jx_Man 987 Nearly a Senior Poster Featured Poster
Dim vPrice As Decimal
        Dim vQty As Integer
        Dim vTotal As Decimal
        Dim vDiscount As Decimal
        Dim vFinal As Decimal

        vPrice = Val(InputBox("Enter a price"))
        vQty = Val(InputBox("Enter a qty"))
        vTotal = Val(vPrice * vQty)

        If vTotal < 20 Then
            vDiscount = vTotal
            vFinal = vDiscount
        ElseIf vTotal >= 20 And vTotal < 49.99 Then
            vDiscount = Val(vTotal) * 0.1
            vFinal = (Val(vTotal) - Val(vDiscount))
        ElseIf vTotal > 50 Then
            vDiscount = Val(vTotal) * 0.2
            vFinal = (Val(vTotal) - Val(vDiscount))
        End If
        MessageBox.Show("Final Price is " & vFinal)
Jx_Man 987 Nearly a Senior Poster Featured Poster

I just wanted to ask you guys how should I proceed with this thing..

more clearly...
u mean the business process??

Jx_Man 987 Nearly a Senior Poster Featured Poster

do you want to populate data in datagrid or other control (label or textbox).
i looks in your code you able to populate in datagrid. so try this to populate in textbox or label.
add this code on your code :

If myReader.HasRows Then	
	While myReader.Read()
		txtFirstName.text= myReader.Item("FirstName") 
	End While
End If
myReader.Close()
november_pooh commented: Got it :) +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi annajee...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

glad to share our knowledge with u :)
Happy coding

Jx_Man 987 Nearly a Senior Poster Featured Poster

glad to it worked...
Happy coding friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Drezta...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Asim...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

yes, here it is the code, try it and let me know if it worked :

Dim AllDir
Private Sub Form_Load()
On Error Resume Next
For i = 65 To 90
x = Dir(Chr(i) & ":\", vbDirectory + vbHidden + vbSystem)

If Err = 52 Then
    Err.Clear
Else
    If x <> "" Then AllDir = AllDir & (Chr(i) & ":\")
      Err.Clear
End If

Next i
MsgBox AllDir
End Sub

Hope this helps...

Neji commented: thank you very much. it was i looking for +1
Sawamura commented: worked +1
dnk commented: spontan uhuy +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

tell me if this code worked...

november_pooh commented: you know this code worked perfect +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

try this following code vega :

Private Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)
Private Type SYSTEM_INFO
    dwOemID As Long
    dwPageSize As Long
    lpMinimumApplicationAddress As Long
    lpMaximumApplicationAddress As Long
    dwActiveProcessorMask As Long
    dwNumberOrfProcessors As Long
    dwProcessorType As Long
    dwAllocationGranularity As Long
    dwReserved As Long
End Type
Private Sub Form_Load()
    Dim SInfo As SYSTEM_INFO
    'Set the graphical mode to persistent
    Me.AutoRedraw = True
    'Get the system information
    GetSystemInfo SInfo
    'Print it to the form
    MsgBox "Number of procesor:" + Str$(SInfo.dwNumberOrfProcessors) & vbCrLf & _
    "Processor:" + Str$(SInfo.dwProcessorType) & vbCrLf & _
    "Low memory address:" + Str$(SInfo.lpMinimumApplicationAddress) & vbCrLf & _
    "High memory address:" + Str$(SInfo.lpMaximumApplicationAddress)
    
    Unload Me
End Sub
Vega_Knight commented: Worked like charm +1
Estella commented: me :condused: +1
Sawamura commented: Approve +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

awesome
both of you is a great coder...

thanks for all your helps guys
i m very happy :D

Thank you...
We just give what we know and glad to share our knowledge :)
Happy coding Friend.

dnk commented: thanks you want to share your knowledge jx_man :) +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

A search across this site (that little box in the upper right corner) on "final year topic" yields 50 pages of results. That should get you started I would think.

yeah, use searching facility and u will find many topic there...
there are too much thread about "final year Topic"

Jx_Man 987 Nearly a Senior Poster Featured Poster

don't felt that, i really like your code.
i happy to know much from you too. you are the great coder, your code always help me and others. So, many alternative solution make it more completed.

Sawamura commented: very welcome :) +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi..Swamp, Welcome to Daniweb friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Anan..Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

also u can write code to put your application on startup folder. so u no need to put your program manually on startup.
see this following code :

Private Sub GetStartUp()
    Dim mShell
    Dim txtFStartUp As String
    Set mShell = CreateObject("WScript.Shell")
    txtFStartUp = mShell.SpecialFolders("Startup")
    
    FileCopy App.Path & "\" & App.EXEName & _
    ".exe", txtFStartUp & "\YourAppName.exe"
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

hmmm....
do like shouvik suggest if u want your program automatically when windows start.

Jx_Man 987 Nearly a Senior Poster Featured Poster

you're welcome friend :)

Vega_Knight commented: great code man +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

you're welcome friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

hi shouvik, its a nice code :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

add it on component.
ctrl + T (or right click on your toolbox / project->component) -> check for Microsoft Common Dialog Control 6.0 -> OK
it will shown on your toolbox.

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

you're welcome :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

to set default button u don't have to fill button style in msgbox or use vbdefaultbutton style.
ex : msgbox("message","Titile") -> it will shown Ok only.
to get other icon do like techtix said.

Jx_Man 987 Nearly a Senior Poster Featured Poster

1. if u didn't use option explicit you don't have to declare that variable
and vb will execute that without any error.
ex : u assign A with checkbox caption without a declared before
A = Check1.Caption -> this operation executed by vb with none error
but if you set option explicit on u must declare it cause u will get error.
ex : use previous sample you need delcare A = dim A as String
One think, Every variable needed initialitation / declare.
It is a good programming to declare all variable.
2. what you means module statment?
in vb.net we write option explicit off in top of all code same like in vb 6
3. in top of all code write "Option Explicit"
4. yes i think. to set on in vb 6 just add "option explicit".

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

yeah...you're welcome :)

Naruse commented: always helping ;) +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

what r u talking about ruchika beddy???

Jx_Man 987 Nearly a Senior Poster Featured Poster

you didn't see my corrected post before.
check post #6 -> i was posted for my corrected code.

Dim x,y as integer
Private Sub Command1_Click()
x = 10
y = 10
Print x + y
End Sub

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi..Welcome to Daniweb Friend :)
you have same hobbies with me :D

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to daniweb friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

hi sonia, u just want to add 2 variable with value. don't make it harder.
i was tried jx_man code and its working nice, shouvik and cometburn code working too. and always try to appreciated others comment.

thanks friend...:)

Jx_Man 987 Nearly a Senior Poster Featured Poster

sorry i wrong :

Dim x,y as integer
Private Sub Command1_Click()
x = 10
y = 10
Print x + y
End Sub

hi sonia, i was tried my code and it giving a result 20 and not an error.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Jx_Man, u can also select the item in the textbox from the listbox without having the button , SEE THE CODE BELOW & Second thing,text given by you to add item from the combobox to listbox is not working.

Hi CometBurn,
SEE The Code Below--
Private Sub List1_Click()
Text1.Text = List1.List(List1.ListIndex)
End Sub

he want to manage it all in one event. so i suggest him to handle all with one button.
and you give a wrong code!!. he want to display input from textbox or combobox into listbox, and you give a code to display item into textbox which it selected on listbox.
Please read his question carefully.

i wan display the item i input in interface text field and combo box, then can display at the list box in that interface too

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Jasme...Welcome to Daniweb Friend :)