|
|
|
Using Date values in VB.NET
|
Total Hit (2172) |
The versatile Date datatype in VB.NET provides a large amount of built in functionality to manipulate dates and times. The ability to add, subtract and compare date values is very useful in particular.
For example, suppose you are managing hundreds of clients in an insurance company. Since insu
....Read More |
Rating
|
|
|
Release COM objects earlier
|
Total Hit (2927) |
If you're using a COM object through COM Interop you should be aware that the object isn't released as soon as you set it to Nothing, as it happens with VB6. Instead, the object will be released only at the first garbage collections that occurs after the object is set to Nothing or goes out of scope
....Read More |
Rating
|
|
|
Retrieve information about the current user
|
Total Hit (2493) |
You can easily retrieve information about the current user by means of a few properties of the Environment class. The Environment.UserName returns the name of the user; the Environment.UserInteractive property returns True if the user is an interactive user; the UserDomainName returns the user's dom
....Read More |
Rating
|
|
|
Calling web services from behind a proxy server
|
Total Hit (2077) |
When you use a web service's proxy class, the calls to the web service might fail if you're behind a proxy server. To solve the problem, you set the Proxy property of a web service's proxy class to an instance of WebProxy, that contains the HTTP proxy settings needed for the web method calls. Here's
....Read More |
Rating
|
|
|
|
|
|
|
Determine whether a string is lowercase
|
Total Hit (3231) |
Here's a quick-and-dirty method to determine whether a string contains only lowercase characters
«Code LangId=2»
' the string to test is in the SOURCE variable
If System.Text.RegularExpressions.Regex.IsMatch(source, "^[a-z]+$") Then
Console.WriteLine("Lowercase string")
End If
«/Code»
....Read More |
Rating
|
|
|
Pasting the text in the Clipboard into a RichTextBox
|
Total Hit (3446) |
«Code LangId=2»' Paste the text currently in the Clipboard into the specified RichTextBox
' Example: PasteIntoRichTextBox (richTextBox1)
Public Sub PasteIntoRichTextBox(ByVal rtb As RichTextBox)
' get the data currently in the Clipboard
Dim data As IDataObject = Clipboard.GetDataObject
....Read More |
Rating
|
|
|
ArrayDeleteElement - Deleting an element in any type of array
|
Total Hit (2556) |
«Code LangId=2»' A generic routine that deletes an element in any type of array.
' Example: deleting the 2nd element of the array arr
' ArrayDeleteElement(arr, 1)
Sub ArrayDeleteElement(ByVal arr As Array, ByVal index As Integer)
' Shift elements from arr(index+1) to arr(index).
....Read More |
Rating
|
|
|
|
Object Oriented features in VB.net (Part-3)
|
Total Hit (8539) |
«big»Inheritance«/big»
Now that VB.Net supports many object oriented features, lets discuss about Inheritance. Inheritance is the cornerstone of Object Oriented programming. VB.net supports inheritance and I am sure VB6 programmers will welcome this step. Inheritance gives us an ability to define
....Read More |
Rating
|
|
|
SOAP Basics : Sample Chapter from Professional XML Web Services
|
Total Hit (1959) |
At the core of the Web Services model is SOAP (Simple Object Acc Protocol), the protocol that allows messages to be transmitted as XML documents and invokes the capabilities of Web Services. The SOAP standard is the key to Web Services.
This chapter delves into SOAP 1.1, and the concepts needed to
....Read More |
Rating
|
|
|
How Do I...Read and Write Resources?
|
Total Hit (742) |
This example illustrates how to read and write resource files through code. You can use other tools (such as Resgen) to write resource files; however, you can also use the ResourceWriter object to create new resource files from scratch, providing the potential to create your own environment for maki
....Read More |
Rating
|
|
|
ADO.NET: Convert an ADO Application to ADO.NET
|
Total Hit (588) |
This is an example of an ADO application that has been ported to .NET without the original graphical interface. It also shows the usage of a forward-only read-only fast DataReader. It shows how to use a DataView class to take a table from a DataSet and operate on it in a fashion similar to the old A
....Read More |
Rating
|
|
|
How Do I...Query XML with an XPath expression?
|
Total Hit (978) |
This sample illustrates how to query an XPathDocument with an W3C XML Path Language (XPath) expression supplied to the XPathNavigator class. The XPathNavigator class is only for read-only XPath queries over a document and, for Extensible Stylesheet Language Transformations (XSLT) processing, is impl
....Read More |
Rating
|
|
|
How Do I... Get Started Using Interoperability?
|
Total Hit (1625) |
The common language runtime's COM interoperability services make it possible to use existing COM objects from within managed applications and expose managed objects to existing COM applications.
Note: Managed code is code that targets the common language runtime.
In addition, the runtime's p
....Read More |
Rating
|
|
|
Adding icons to menus in VB.NET
|
Total Hit (2120) |
This project add icons in menus in VB.NET. You can use the module 'IconsMenuMain.vb' as base of your project for adding icons. This is most easy that vb6 or other languaje
|
Rating
|
|
|
|
How Do I...Call a Function Exported From an Unmanaged Library?
|
Total Hit (1758) |
This example demonstrates how to call a function exported from an unmanaged library from managed code. The MessageBox routine in User32.dll and GetSystemTime routine in Kernel32.dll are called. The same technique can be used to call any exported function in any other library.
In order to call Me
....Read More |
Rating
|
|
|
|
ADO.NET: Filter Data
|
Total Hit (544) |
There are many ways to filter data. One way is to filter data at the database command level, using a where clause on your query. A second way is to filter the data after it is in the DataSet. This topic covers filtering in the DataSet.
Once data is in a DataSet you can use methods on the DataSet t
....Read More |
Rating
|
|
|
Utilizing Regular Expressions
|
Total Hit (1671) |
This article is a follow-up to an earlier 4Guys article, An Introduction to Regular Expression with VBScript. (If you are not familiar with regular expressions, I highly recommend that you read the An Introduction to Regular Expression with VBScript article!) Since the previous article served more a
....Read More |
Rating
|
|
|
|
Skinned ListBar
|
Total Hit (1937) |
This article demonstrates overriding the drawing routines in the Outlook Style ListBar to create a new ListBar which inherits the behaviour of the original control but draws in a much customised way.
|
Rating
|
|
|
Using Threads
|
Total Hit (2302) |
This article explains the different models of threading — single, apartment, and free — and the use of each model. It also introduces a code sample in C# that uses threading to help you write applications that will take advantage of threading. The article also discusses important issues involved in
....Read More |
Rating
|
|
|
Serialize VB.NET objects without the events
|
Total Hit (1958) |
Because of the way VB.NET implements events, when you serialize an object, its events get serialized too (because events are actually implemented using hidden multicast delegate fields). A side effect of this is that any object which handles events raised by the object being serialized will be consi
....Read More |
Rating
|
|