DIGIT-ARC read-only archive · snapshot: July 23, 2026

vb tricks

22 posts · originally from https://geek.digit.in/community/threads/vb-tricks.6865/

Manojap
Manojap Original post #1
Mar 13, 2005 at 6: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=�*www.manojapnair.bravehost.com�
End Sub
:roll: :roll:
R
Mar 13, 2005 at 7: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
Mar 14, 2005 at 1:58 AM
the above tut given by Manojap is useful. A new to VB must try it.
/
Mar 14, 2005 at 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...
H
h4xbox #5
Mar 14, 2005 at 7:58 PM
is tht a trick ?? I guess u are requesting a program
Manojap
Manojap #6
Mar 19, 2005 at 1:51 PM
rajkumar_personal said:
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
Manojap #7
Mar 19, 2005 at 1:56 PM
I get one copy of this prgrm from Developer IQ CD,last year
T
Tux #8
Mar 25, 2005 at 9: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
tuxfan #9
Mar 26, 2005 at 12:19 PM
Yes mr Tux aka Ash :D I want it. How can you send it to me?
R
Mar 27, 2005 at 5: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 !
T
Tux #11
Mar 27, 2005 at 12:41 PM
rajkumar_personal said:
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.
T
Tux #12
Mar 27, 2005 at 12:43 PM
tuxfan said:
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
T
Mar 31, 2005 at 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!
T
Tux #14
Apr 1, 2005 at 7:03 PM
Send it buddy. I'll give you the whole
source code and forms along.
Its OK . Send your email-id.
T
Tux #15
Apr 1, 2005 at 9: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
T
Tux #16
Apr 10, 2005 at 11:05 PM
hOW WAS TH PROG. sOMEONE REPLY PLZ
I
igeek #17
Apr 11, 2005 at 2:35 AM
Tux said:
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
T
Tux #18
Apr 13, 2005 at 7:16 PM
igeek said:
Tux said:
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.
I
igeek #19
Apr 13, 2005 at 10:36 PM
Tux said:
I know I know.
Its damn basic.
But Read the README. U'll know why.
:wink: :D
casanova
casanova #21
Aug 1, 2006 at 4:15 PM
Tux, I aslos need ur proggy. instead of sending it individually , u can upload it to rapidshare and post the link.
Venom
Venom #22
Aug 1, 2006 at 4:26 PM
Cant you notice Tux isnt a member here anymore? Why dig up useless threads...