|
|
InputBox - A .NET replacement for this VB6 function
|
Total Hit (3458) |
«Code LangId=2»' Create an InputBox like the one of VB6. You can define the dialog's title,
' question and default value.
' Example: MessageBox.Show(InputDialog.InputBox("Type your name:", "Test",
' "Marco"))
Public Class InputDialog
Inherits System.Windows.Forms.Form
#Region " Windo
....Read More |
Rating
|
|
|
Retrieving the hi/low byte/word of a value, and other operations
|
Total Hit (4245) |
As explained in the tip about the ARGBColor structure (look at the end of this tip for the link), we can define a structure and have its fields that point to the same memory address, but that read a different number of bytes. This makes easier to define a structure that allows us to set a value to a
....Read More |
Rating
|
|
|
|
|
FormatSize - Format a size expressed in bytes
|
Total Hit (2479) |
«Code LangId=2»
' Returns a formatted string that shows the size in Bytes, KBytes or MBytes
' according to the size
' Usage:
' Dim ProperSizeString As String = FormatSize("132100842")
' -> returns "125.98 MB"
Function FormatSize(ByVal SizeInBytes As Double) As String
If SizeInBytes
....Read More |
Rating
|
|
|
Singleton Design Patten in VB.NET
|
Total Hit (2799) |
The Singleton pattern ensures that only one instance of a class is created. All objects that use an instance of that class use the same instance. This is the most common design pattern, and easy to implement, but very powerful when used properly.
|
Rating
|
|
|
Adding an image as an embedded resource, and loading it from code
|
Total Hit (3634) |
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
|
|
|
Multi-column menus
|
Total Hit (3568) |
The new Break and BarBreak properties of the MenuItem object let you create menus with multiple columns. All you have to do is set either property to True for the MenuItem object that must become the first item of a new menu column. The only difference between these two properties is that BarBreak d
....Read More |
Rating
|
|
|
|
|
Reducing string memory usage with the Intern method
|
Total Hit (2971) |
A .NET application can optimize string management by maintaining an internal pool of string values known as intern pool. If the value being assigned to a string variable coincides with one of the strings already in the intern pool, no additional memory is created and the variable receives the addres
....Read More |
Rating
|
|
|
Exception debugging in Visual Studio .NET
|
Total Hit (2552) |
The Visual Studio debugger offers complete control on what happens when an application throws an exception, or calls a .NET method that throws an exception. You set all the relevant options from inside the Exceptions dialog box, which you bring up with the Debug | Exceptions menu command. This dialo
....Read More |
Rating
|
|
|
Avoid duplicate entries for the same serviced component
|
Total Hit (2612) |
A common mistake when creating a .NET component that runs under Component Services - that is, a class that inherits from ServicedComponents - is that you forget to assign a fixed version and/or GUID to the component being built. In this case, whenever the assembly is modified and recompiled, a new v
....Read More |
Rating
|
|
|
|
|
Running ILDASM from inside Visual Studio .NET
|
Total Hit (3022) |
Nothing beats ILDASM when it's time to understand what your VB.NET or C# compiler actually emits. In this case you should prepare a desktop shortcut to ILDASM so that you can run it quickly, and then open a Windows Explorer window on the Bin directory of your project, so that you can easily drag you
....Read More |
Rating
|
|
|
Convert a binary, octal, or hexadecimal value to decimal
|
Total Hit (4001) |
The Convert class offers a few static methods that let you easily and quickly convert a binary, octal, or hexadecimal number(stored in a String) into the equivalent Byte, Short, Integer, or Long value. These are the methods in question:
«Code LangId=2»Dim b As Byte = Convert.ToByte(value, fromB
....Read More |
Rating
|
|
|
|
How Do I...Read and write large files?
|
Total Hit (1386) |
This sample demonstrates how to write a large file and read it back in. This sample also shows how to time such operations. It accepts a file size (measured in kilobytes) from the user, indicating the size of the file to create. The larger the specified size, the longer the process will take to both
....Read More |
Rating
|
|
|
Introduction to Exception Handling in Visual Basic .NET
|
Total Hit (965) |
This article provides an overview of structured and unstructured exception handling in Visual Basic .NET. It includes considerations that help you choose the right exception-handling alternative, the approaches involved in each alternative, how to create your own exceptions, and the exception object
....Read More |
Rating
|
|
|
Highlighting and Shadowing Image List Images
|
Total Hit (1980) |
For some reason, the System.Windows.Forms.ImageList does not provide a Draw method that allows an image to be drawn highlighted or selected, even though this is part of the basic functionality of the underlying ComCtl32 ImageList. This article provides a method of drawing selected and lightened imag
....Read More |
Rating
|
|
|
Building a Stock-Quotes Web Service
|
Total Hit (1368) |
I guess you might be having some information on what Web Services. If not you can read .net101's article about Web Service Part 1 -Basics. In the current article we will be concentrating on building and consuming a Web Service which delivers "Stock Quotes" on the .NET Platform. We will be using Yaho
....Read More |
Rating
|
|
|
|
Walkthrough: Loading SQL Server Data into a Word Table
|
Total Hit (994) |
Learn to programmatically load data into a Word table from a SQL Server database by taking advantage of ADO.NET to access data, and using Microsoft Visual Studio Tools for the Microsoft Office System to create your project.
|
Rating
|
|
|
Object Oriented Programming with VB.NET and C#
|
Total Hit (485) |
.NET is fully object oriented platform that allow languages to take full advantage of these OO features. The features include:
«LI»Namespace
«LI»Classes
«LI»Objects
«LI»Encapsulation
«LI»Overloading
«LI»Inheritance
«LI»Overriding
«LI»Interfaces
«LI»Polymorphism
....Read More |
Rating
|
|
|
Packet Capture and Analayzer
|
Total Hit (2307) |
The first idea of writing a packet sniffer program came from a reply to my comments on one of the projects named "NetSend ( Sending popup messenger messages between computers )" by Marc Clifton. Marc asked me "What about receiving message". To say the truth, I didn't know how I could do that. I knew
....Read More |
Rating
|
|
|
How Do I...Create a Client of a Remote Server?
|
Total Hit (757) |
If you haven't already read the section How Do I Create a Remote Server?, please read this first. The client references the server assembly for metadata, so you have to compile the server before the client. The code for the client is listed below.
....Read More |
Rating
|
|
|
How Do I...Create Resources?
|
Total Hit (659) |
Creating resources can help you develop robust, culture-aware programs without having to recompile your application because the resources have changed. The steps for creating and subsequently using resources are covered in this topic.
|
Rating
|
|
|
How Do I...Create DataSet mappings from an XSD schema?
|
Total Hit (959) |
This sample illustrates how to create DataSet mappings from a supplied XML Schema Definition language (XSD) schema. Generally, schemas are metadata, or data about data, but XSD schemas also cover the relationships between data types. From a schema, you can create a relational structure of tables and
....Read More |
Rating
|
|