|
|
Adding an image as an embedded resource, and loading it from code
|
Total Hit (2614) |
To add an image as an embedded resource in a Windows Forms application, add the image file to the project with Project | Add Existing Item. Then select the file in the Solution Explorer, go to the Properties Window, and set its Build Action property to Embedded Resource. At this point the file will
....Read More |
Rating
|
|
|
|
Case insensitive replace in .net
|
Total Hit (12024) |
Sounds easy right.... but sometimes it can take your entire day how to do that using String Replace method. By default .Net string operations are case sensetive. In order to do case insensitive you need to use Strings.Replace method this is another replace method provided for VB programmers.
«co
....Read More |
Rating
|
|
|
CompareFiles - Comparing two binary/text files
|
Total Hit (2735) |
«Code LangId=2»' Returns a boolean indicating whether two files are equal
' Example: Debug.WriteLine(CompareFiles("D:\File1.mdb", "D:\File2.mdb"))
Function CompareFiles(ByVal path1 As String, ByVal path2 As String) As Boolean
Dim file1 As New System.IO.FileInfo(path1)
Dim file2 As New
....Read More |
Rating
|
|
|
|
Take advantage of the new math functions
|
Total Hit (3000) |
The System.Math class exposes several static methods that let you perform many common operations. These functions replace the VB6 functions with same name, but there are a few new functions that have no direct VB6 counterpart:
Ceiling(x) returns the integer equal or higher than the argument
Floo
....Read More |
Rating
|
|
|
|
|
|
Iterating over the characters in a string
|
Total Hit (2857) |
Visual Basic .NET strings support the For Each statement, so you can iterate over each individual character as follows:
«Code LangId=2»
Dim s As String = "ABCDE"
Dim c As Char
For Each c In s
Console.Write(c & ".") ' => A.B.C.D.E.
Next
«/Code»
However, you should bear in mind th
....Read More |
Rating
|
|
|
ExplodeString - Add a filling char between a string's chars
|
Total Hit (2495) |
«Code LangId=2»
' "Explode" a string by inserting a given filling character
' between consecutive characters in the original string
'
' The source string cannot contain Chr$(0) characters
Function ExplodeString(ByVal Source As String, Optional ByVal fillChar As Char = _
" "c) As String
....Read More |
Rating
|
|
|
|
|
Dashed lines with custom caps
|
Total Hit (4290) |
You can set properties of the Pen object to create custom lines. For example, you can use the DashStyle enumerated property to draw dashed lines using a predefined pattern, and you can even create custom dash patterns by assigning an array of Single values to the DashPattern property. The StartCap a
....Read More |
Rating
|
|
|
|
Exclude code portions with the Conditional attribute
|
Total Hit (3240) |
VB developers have always used the #IF compiler directive to include or esclude portions of code from the application. The problem with this directive is that you can easily exclude a procedure with a single directive, but it isn't easy to discard all the calls to that procedure (which would raise a
....Read More |
Rating
|
|
|
|
Efficiently Searching a Sorted Array
|
Total Hit (1525) |
Pop quiz, hotshot: you have an array of strings consisting of the various IP addresses of the visitors of the last 24 hours to your Web site. You want to determine if your site has been visited by the IP address 231.34.124.3. How can you quickly figure out if the string "231.34.124.3" is in the arra
....Read More |
Rating
|
|
|
Receiving and Using Clipboard Change Notifications
|
Total Hit (2241) |
Clipboard support in the .NET Framework is fairly comprehensive, however, support for notification of clipboard changes is not provided. Knowing when the clipboard changes makes building an application with a toolbar containing a Paste button simpler; it also enables you to store a history of clipbo
....Read More |
Rating
|
|
|
Multithreaded Programming with Visual Basic .NET
|
Total Hit (1170) |
The .NET Framework provides new classes that make it easy to create multithreaded applications. This article discusses how you can use multithreaded programming techniques with Visual Basic® .NET to develop more efficient and responsive applications.
....Read More |
Rating
|
|
|
|
Flat Style Combo Boxes
|
Total Hit (2100) |
This article provides a class which you can attach to any .NET ComboBox control to allow it to render with a VS.NET or Office XP flat style by subclassing the messages associated with the control (VB.NET and C# code provided).
|
Rating
|
|
|
DataSets in Microsoft .NET - 1
|
Total Hit (1779) |
ADO.NET was designed to meet the needs of this new programming model: disconnected data architecture, tight integration with XML, common data representation with the ability to combine data from multiple and varied data sources, and optimized facilities for interacting with a database, all native to
....Read More |
Rating
|
|
|
|
XML Web Services (RPC the Easy Way)
|
Total Hit (2187) |
This sample chapter covers following things
«LI»The Role of XML Web Services in a Distributed System
«LI».NET Remoting vs. XML Web Services
«LI»XML Web Service Plumbing
«LI»The Role of IIS
«LI»Creating a Virtual Directory
«LI»The XML Web Service File Format
«LI»Creating an XML Web Service
....Read More |
Rating
|
|
|
|
How Do I...Make an Asynchronous Call to a Remote Object?
|
Total Hit (740) |
All the examples up to this point made synchronous calls to the remote object. This strategy might not always be desirable since the remote object might have to perform a number of time-consuming tasks and it is not advisable to block the client while a call is in progress. This example demonstrates
....Read More |
Rating
|
|
|
Safe, Simple Multithreading in Windows Forms, Part 2
|
Total Hit (1086) |
Explores how to leverage multiple threads to split the user interface (UI) from a long-running operation while communicating further user input to the worker thread to adjust its behavior, thus allowing a message-passing scheme for robust, correct multithreaded processing.
....Read More |
Rating
|
|
|