|
How to display Error Line Number in VB
|
Total Hit (2727) |
In VB you can display error line number. Its little tedious job but it works fine. you have assign numbers to lines where you want to track error line number. These line numbers should be unique within function or sub.
|
Rating
|
|
|
|
|
Tutorial on Working with File I/O in VB6
|
Total Hit (3953) |
«b»Reading from a file«/b»
«code LangId=1»Public Function ReadFromFile(FilePath As String) As String
Dim iFile As Integer
Dim s As String
'//Check for File Path
If Dir(FilePath) = "" Then Exit Function
On Error GoTo ErrorHandler:
iFile = FreeFile
Open FilePa
....Read More |
Rating
|
|
|
|
|
How to Cancel Printing job sent to Printer.
|
Total Hit (3033) |
To learn more about Printing Using API click on the folloing link
«a href='http://msdn.microsoft.com/library/en-us/gdi/prntspol_0r1j.asp'»http://msdn.microsoft.com/library/en-us/gdi/prntspol_0r1j.asp«/a»
|
Rating
|
|
|
Path API Demo (BeginPath, EndPath, AbortPath)
|
Total Hit (4257) |
This is very simple demo to demonstrate how to use path API in grawing.
To learn more about path Please visit following URL
«a href='http://msdn.microsoft.com/library/en-us/gdi/paths_8acz.asp'»http://msdn.microsoft.com/library/en-us/gdi/paths_8acz.asp«/a»
«b»To implement Quick Demo, Copy/Past
....Read More |
Rating
|
|
|
|
How to shutdown remote machine on a network using API.
|
Total Hit (4809) |
This demo will show you how to shutdown remote machine in a specified interval. When you shutdown machine you will see following warning message.
«BR»«P Align=center»«img src='/Main/Articles/Lang1/Cat3/Code3580/image3580_1.gif'/»«/P»«BR»
«b»For Quick Demo«/b»
1. Start a new project in Vis
....Read More |
Rating
|
|
|
How to display API Error Description.
|
Total Hit (3974) |
When you execute any system API generally it returns success/failure using return value. To find out any error you have to use GetLastError api or Err.LastDllError property of Err object in VB. But it will return only ErrorCode not description. You can use following code to get description of API Er
....Read More |
Rating
|
|
|
|
|
|
|
|
Create all the sub directories of specified path.
|
Total Hit (2188) |
Sometimes we need to create a directory if it doesn't exist. It is easy to create directories using VB. You can use «b»MkDir«/b» function. But what if we need to create all directories of specified path if none of them exists? Well, if you are running Win2K or higher then its easy. You can use follo
....Read More |
Rating
|
|
|
|
How to set NTFS permission programatically using Security APIs
|
Total Hit (5326) |
Using security APIs you can set NTFS permissions in more technical term you can change ACL (Access Control List) for a user.
Here for demo purpose I have created a user called "tejuwala" and I have created a folder c:\test and two files c:\test\file_a.txt and c:\file_b.txt . User tejuwala dont ha
....Read More |
Rating
|
|
|
How to retrive font name from font file.
|
Total Hit (2964) |
I tried so many places but never found any simple code which retrive font name. Because to set font for drawing/printing we have to set font name and ususally font name is different than file name.
|
Rating
|
|
|
How to disable word wrap in RichTextBox control
|
Total Hit (2873) |
By default rich textbox control wrap a long line. Sometimes we want to disable this inbuilt feature then here is some trick.
set RightMargin property to an arbitary high value which will not wrap your long line.
Happy Programming....
|
Rating
|
|
|
How to open a file with Wordpad or Notepad
|
Total Hit (2901) |
I tried to find sourcecode which allows me to open a file with any extension with Wordpad and Notepad. And finally I came up with this solution.
Happy Programming....
|
Rating
|
|
|
|
|
Programmatically Select a Node in TreeView.
|
Total Hit (3290) |
This is very easy but tricky. By default HideSelection property of treeview is true. So it confuses many programmer. When you use Treeview.Selected=True and HideSelection is True then it wont show the selection even though node is selected. Check the following example for that
....Read More |
Rating
|
|
|
|
Setting Custom Paper Size using Printer API
|
Total Hit (33692) |
Here is the alternate method which shows how to use printer APIs to set custom papersize and other printer properties using API. This code will work with Win9x and WinNT both.
|
Rating
|
|
|
Tutorial - ListView Control Introduction
|
Total Hit (1698) |
The list view control is basically and advanced ListBox. This control allows you to add rows of data, but it also supports large and small icons, multiple columns, automatic label edit, column re-order, hot-tracking, the four main modes that you see in explorer:
Icon - Displays items with large i
....Read More |
Rating
|
|
|
Tutorial - Image List Control Introduction
|
Total Hit (2135) |
The Image List control allows you to add images to your program, which you can use in the other Common Controls (Toolbar, TreeView, ListView etc). To add the ImageList control to your VB project, click Project|Components, and check the box next to Microsoft Windows Common Controls x.x where x is the
....Read More |
Rating
|
|
|
HTTP file upload from VB
|
Total Hit (2992) |
This ActiveX control allows users to submit a file to a Web server. This component uses the WinSocket control to submit files using the file transfer protocol (FTP). It only worked in Internet Explorer 3.02 and higher, and several clients used Netscape, so I had to find another solution.
....Read More |
Rating
|
|