|
Convert dates entered by user as strings to VB Date values.
|
Total Hit (3625) |
This code formats a date string entered by the user, adding slashes and correct number of year digits and converts it to a proper date format.
You can use the following code to make your user interface more friendly. It will help you in correcting and preventing mistakes over what date is entered.
....Read More |
Rating
|
|
|
How to compress files and data in VB.net
|
Total Hit (3678) |
<b>"Compressing files and data",</b><br>
<a href="http://dotnet.mvps.org/dotnet/faqs/?id=compression&lang=en">
http://dotnet.mvps.org/dotnet/faqs/?id=compression&lang=en</a><br>
<br>
Compressing files and data<br>
CAB format:<br>
Microsoft Cabinet Software Development Kit<br>
<a
....Read More |
Rating
|
|
|
Use a ParamArray as a true array
|
Total Hit (2705) |
Unlike VB6, in VB.NET the ParamArray keyword defines a true array object, which you can process using any of the methods of the Array class. For example, here' s a function that evaluates the lowest value among those passed to the procedure, using the static Array.Sort method and then taking the ele
....Read More |
Rating
|
|
|
Adding events dynamically in a Windows Form
|
Total Hit (2882) |
The new AddHandler statement makes it possible to attach event dynamically, that is without having to bind them via static code based on the Handles keyword. This keyword is also useful to have all the controls on a form share the same event procedure.
For example, say that you want to change th
....Read More |
Rating
|
|
|
HTML Color Coding for various Languages (i.e. VB, VB.net, SQL).
|
Total Hit (10645) |
I spent several hours to find some article to convert Source Code into HTML with different colorcode for keywords/literal/comment/function. But no luck and finally I wrote my own ColorCoding Engine. This article will show you how you can utilize power of Regular Expression to solve your very complex
....Read More |
Rating
|
|
|
Write a console utility to list processes
|
Total Hit (4074) |
The Process class provides all you need to create a command-line utility that lists all the processes running on the system and all the related information. This utility is therefore similar to the Windows Task Manager, except you can run it from the command prompt. All processes are sorted alphabet
....Read More |
Rating
|
|
|
Pasting data from the Clipboard
|
Total Hit (6262) |
Pasting data from the clipboard requires more code because you must ascertain whether the clipboard contains data in one of the formats you're willing to process. First, use the Clipboard.GetDataObject to retrieve an IDataObject object. Next, use the GetDataPresent method of this IDataObject object
....Read More |
Rating
|
|
|
Mail Tutorial in VB.NET
|
Total Hit (3297) |
Microsoft has made life more easy by adding an in-built .NET class for SMTP Mail. This article will show you how you can take advantage of System.Web.Mail namespace in VB.Net
«B»Basic Mail Message«/B»
«Code LangId=2»
Imports System.Web.Mail
Dim m As New System.Web.Mail.MailMessage()
Wi
....Read More |
Rating
|
|
|
|
|
Right-align formatted strings
|
Total Hit (3323) |
The String.Format function supports many formatting options, but none allows you to display right-aligned columns of numbers, as in:
1.00
12.00
123.00
1,234.00
However, you can easily create a helper function that works like String.Format, takes an additional length argument,
....Read More |
Rating
|
|
|
FormatValue - Format a value in a column of given width
|
Total Hit (2725) |
«Code LangId=2»
Enum FormatColumnAlignment
Left
Center
Right
End Enum
' format a value in a column of given width and with specified alignment
' using the specified pad character
Function FormatValue(ByVal value As String, ByVal width As Integer, _
ByVal alignment As F
....Read More |
Rating
|
|
|
|
|
|
|
|
|
How do I create classes from an XSD schema?
|
Total Hit (997) |
This topic describes how to create classes that can be used to read and write XML that is defined by an XML Schema Description (XSD) file. Once you understand how to generate the classes for your XSD schema, you should read the "How Do I Read and Write Objects From XML?" topic to find out how to act
....Read More |
Rating
|
|
|
|
|
|
Walkthrough: Working with Offline SQL Server Data in Excel
|
Total Hit (1034) |
Microsoft Office Excel makes it easy to work with rectangular data, such as data from an external database. In this walkthrough, you'll load data from Microsoft SQL Server into an ADO.NET dataset. You'll then use the Excel object model to support synchronizing changes made to the data in Excel with
....Read More |
Rating
|
|
|
How Do I...Read and write binary data?
|
Total Hit (1656) |
This sample illustrates basic binary file input and output using the BinaryReader, BinaryWriter and FileStream classes. A similar topic is presented under the heading How Do I...Create a log file?. Reading and writing binary information enables you to create and use files that are not accessible thr
....Read More |
Rating
|
|
|
How Do I...Create a Remote Object as a Singleton?
|
Total Hit (822) |
This example demonstrates how to modify the Client/Server example by deploying the remote object as a singleton. The client starts two threads and calls the CountMe method on the server on two different channels: TCP and HTTP. Although this example is very simple, it does illustrate a few important
....Read More |
Rating
|
|
|
Manipulating Windows Event Log
|
Total Hit (1952) |
Windows Event Log keeps track of system wide and application level events. These events messages constitute things such as information messages, error messages, warnings and alerts. If your system is giving some troubles event log is the first place an administrator will look into. .NET framework pr
....Read More |
Rating
|
|
|
Simple Interprocess Communications using WM_COPYDATA
|
Total Hit (2301) |
Whilst the .NET Framework has some very sophisticated techniques for communication between processes on different machines, it doesn't provide so much support for communication between processes on the same machine. The Windows API offers a rich set of inter-process communications features, at vario
....Read More |
Rating
|
|
|
Working with OwnerDraw Menus in VB.NET
|
Total Hit (2036) |
When a menu is constructed with the VS IDE menu editor, it's very easy to add menu items and set up the hierarchy of the menu structure. Using just a few mouse clicks and a few keystrokes, your whole menu structure can created in just a few minutes. "So", you may ask, "how do we get these cool image
....Read More |
Rating
|
|
|
Adding an Icon or Control to a TextBox or ComboBox
|
Total Hit (2575) |
The standard .NET Framework ComboBox does not support an icon in the text box section of the control. This article presents a class which can be used to show an icon, a control or a custom-drawn image into any TextBox or ComboBox (VB.NET and C# code provided).
....Read More |
Rating
|
|
|
How Do I...Navigate XML with the XPathNavigator?
|
Total Hit (1010) |
This sample illustrates how to navigate XML documents with an XPathNavigator created from an XPathDocument. It also demonstrates how to use an XPathNodeIterator. The XPathNavigator class provides a cursor-style model to navigate an XML document. This topic also introduces XML Path Language (XPath) e
....Read More |
Rating
|
|