PDA

View Full Version : vb tricks


Manojap
13-03-2005, 06:48 PM
Pls copy paste these code to ur visual basic form’s code section.

1.Invoke folder selection dialog box to ur Visual Basic application / use of windows handles

Private Type BROWSEINFO
hOwner As Long
pidlRoot As Long
pszDisplayName As String
lpszTitle As String
ulFlags As Long
lpfn As Long
lParam As Long
iImage As Long
End Type
Private Const BIF_RETURNONLYFSDIRS = &H1
Private Declare Function SHGetPathFromIDList Lib "SHELL32.DLL" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Private Declare Function SHBrowseForFolder Lib "SHELL32.DLL" Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long 'ITEMIDLIST

Public Function BrowseFolder(hWnd As Long, szDialogTitle As String) As String
' Syntax: StrVar = BrowseFolder(hWnd, StrVar)
On Local Error Resume Next
Dim X As Long, BI As BROWSEINFO, dwIList As Long, szPath As String, wPos As Integer
BI.hOwner = hWnd
BI.lpszTitle = szDialogTitle
BI.ulFlags = BIF_RETURNONLYFSDIRS
dwIList = SHBrowseForFolder(BI)
szPath = Space$(512)
X = SHGetPathFromIDList(ByVal dwIList, ByVal szPath)
If X Then
wPos = InStr(szPath, Chr(0))
BrowseFolder = Trim(Left$(szPath, wPos - 1))
Else
BrowseFolder = vbNullString
End If
End Function

Private Sub Form_Click()
Dim sFileName As String
sFileName = BrowseFolder(Me.hWnd, "Select the folder to Protect")

End Sub


2.Function to Check whether a folder exist or not , this function will return true if the folder exist.Pls modify above code..

Public Function IsFolderExists(FolderName As String) As Boolean
Dim fs
Set fs = CreateObject("Scripting.FileSystemObject")
IsFolderExists = fs.FolderExists(FolderName)
End Function

Private Sub Form_Click()
Dim sFileName As String
sFileName = BrowseFolder(Me.hWnd, "Select the folder to Protect")
MsgBox (IsFolderExists(sFileName))
End Sub

3.Run a weblink or mailto link using shell command from Visual Basic application/set hypperlink.

General Declaration section
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 AppName = "Dictionary"


Private Sub mail_Click()
ShellExecute 0, "Open", "mailto:" & mail.Caption, vbNullString, vbNullString, vbNormal
End Sub

Private Sub web_Click()
ShellExecute 0, "Open", web.Caption, vbNullString, vbNullString, vbNormal
End Sub
Private Sub Form_Load()
mail.caption=�maojap.nair@gmail.com�
web.caption=�http://www.manojapnair.bravehost.com�
End Sub
:roll: :roll:

rajkumar_personal
13-03-2005, 07:05 PM
Why don't u mention that u have copied the sources from VB progs written by others ?

All of this crap can be easily located on
www.planetsourcecode.com

MENTION the place u have copied stuff.......ALWAYS !!!

sms_solver
14-03-2005, 01:58 AM
the above tut given by Manojap is useful. A new to VB must try it.

//siddhartha//
14-03-2005, 10:00 AM
Can anybody suggest me VB.NET tricks for making a simple calculator for calculating marks and percentage of exam results for 7 subjects...

h4xbox
14-03-2005, 07:58 PM
is tht a trick ?? I guess u are requesting a program

Manojap
19-03-2005, 01:51 PM
Why don't u mention that u have copied the sources from VB progs written by others ?

All of this **** can be easily located on
www.planetsourcecode.com

MENTION the place u have copied stuff.......ALWAYS !!!


The program is completely my own,who says it found on palnet....manoj

Manojap
19-03-2005, 01:56 PM
I get one copy of this prgrm from Developer IQ CD,last year

Tux
25-03-2005, 09:30 PM
I am developed a TIC TAC TOE game with AI.
Computers responds to our steps wisley.
But its a 250 + pg code.
Any body wants it.

tuxfan
26-03-2005, 12:19 PM
Yes mr Tux aka Ash :D I want it. How can you send it to me?

rajkumar_personal
27-03-2005, 05:17 AM
Yeah.............................
I'm Interested in ur program Tux !
Plz mail it to me since I guess it would be difficult to post the bulky document here !
Plz include all the forms and other files in a zip archieve !

Tux
27-03-2005, 12:41 PM
Yeah.............................
I'm Interested in ur program Tux !
Plz mail it to me since I guess it would be difficult to post the bulky document here !
Plz include all the forms and other files in a zip archieve !

I've sent it. There is still a bug.
And I just can't correct it.
Though the bug don't create problem.

Tux
27-03-2005, 12:43 PM
Yes mr Tux aka Ash :D I want it. How can you send it to me?


why don't u give your email id.
and thank that u r my fan.
U R TUXFAN
and i am TUX.
And also delete aka ash

technovice
31-03-2005, 10:54 PM
Hi!! Tux
Can i get the game too!
It would be great if you can provide the source code with it!
i'll pm my email id if its ok with you!

Tux
01-04-2005, 07:03 PM
Send it buddy. I'll give you the whole
source code and forms along.
Its OK . Send your email-id.

Tux
01-04-2005, 09:13 PM
DAMN TIRED of sending it to people.
But that doesn't means u won't get it.

Log on to
tictactoetux@rediffmail.com
with the password "thanku" and download
the massage from "SNEHASIS GHOSH"
with no subject. Download the attacment and check it out

Tux
10-04-2005, 11:05 PM
hOW WAS TH PROG. sOMEONE REPLY PLZ

igeek
11-04-2005, 02:35 AM
hOW WAS TH PROG. sOMEONE REPLY PLZ
I just downloaded it & tried it. It looks ok but its just sort of basic, no? I was able to beat it in 4 straight moves 5 times before getting a draw the 6th time. When you mentioned AI, I thought something hi-fi, you know..... :wink:

Still, its not bad!!! :D

Tux
13-04-2005, 07:16 PM
hOW WAS TH PROG. sOMEONE REPLY PLZ
I just downloaded it & tried it. It looks ok but its just sort of basic, no? I was able to beat it in 4 straight moves 5 times before getting a draw the 6th time. When you mentioned AI, I thought something hi-fi, you know..... :wink:

Still, its not bad!!! :D

I know I know.
Its damn basic.
But Read the README. U'll know why.

igeek
13-04-2005, 10:36 PM
I know I know.
Its damn basic.
But Read the README. U'll know why.

:wink: :D

Tux
14-04-2005, 01:32 PM
I know I know.
Its damn basic.
But Read the README. U'll know why.

:wink: :D

tnks for repling

casanova
01-08-2006, 04:15 PM
Tux, I aslos need ur proggy. instead of sending it individually , u can upload it to rapidshare and post the link.

Venom
01-08-2006, 04:26 PM
Cant you notice Tux isnt a member here anymore? Why dig up useless threads...