Chart Control General

Installing Microsoft Chart Control for .NET Framework is an add on to VS2008. See here for details of getting it:- http://code.msdn.microsoft.com/mschart or search for “Microsoft Chart Control”. (Microsoft’s chart control is, in fact, a scaled-down version of the Dundas Chart Control.) Also get the Microsoft Chart Controls Add-on for Microsoft Visual Studio 2008 Adding to […]

Read More

Using List View Control

The ListView control is similar to a ListBox but with much more versatile options. It provides a number of different ways items can be viewed and items can also have subitems that contain information that is related to the parent item. Alternatives to List View If you want to use images in columns other than column […]

Read More

Strings General

The string type is a library type and is actaully an array of char or wchar_t. The last character in a string is always null. The library takes care of managing the memory associated with storing the elements. As well as being less powerful, C-style strings are the root cause of many many security problems, […]

Read More

String Builder

When you want to manipulate and edit strings use StringBuilder rather than String. StringBuilder^ myString = gcnew StringBuilder(“Hello World”, 30); //Start off with 30 character capacity (will auto grow as needed)

Read More

Display Values In A String

Display Values With Decimal Places When formatting numbers you can use “0” as mandatory place and “#” as optional place. Display Decimal Value Display Decimal Places Display Hex Value Display Binary Value Display Software Version Typical Solution Display DateTime Link to all format codes Good Examples http://blogs.msdn.com/b/kathykam/archive/2006/03/29/564426.aspx Another Example

Read More

Adding binary values to strings

Use this myString = Convert::ToChar(MyVariable0); myString += Convert::ToChar(MyVariable1); myString += Convert::ToChar(MyVariable2); If you get a problem with starting a string do this myString = Convert::ToString(Convert::ToChar(MyVariable0)); myString += Convert::ToChar(MyVariable1); myString += Convert::ToChar(MyVariaqble2);

Read More

Monitors General

Minimum Screen Size To Design For Netbooks often use 1024 x 600 screen resolution. Windows 7 taskbar is 40 pixels high (?), however a netbook user is likely to set the taskbar to auto hide. Single Monitor Systems int height = Screen::PrimaryScreen->Bounds.Height; int width = Screen::PrimaryScreen->Bounds.Width; Screen ^PrimaryScreen = Screen::PrimaryScreen; this->Width = PrimaryScreen->WorkingArea.Width; Multiple Monitor […]

Read More

Storing Form Location

Variables private: int PositionTopLast; private: int PositionLeftLast; In the forms Constructor PositionTopLast = 0x7fffffff; PositionLeftLast = 0x7fffffff; Form Load //SET FORM TO LAST LOCATION try { if (PositionTopLast != 0x7fffffff) { this->Top = PositionTopLast; this->Left = PositionLeftLast; } } catch (Exception ^) { } Form Position Changed private: System::Void frmMyForm_ResizeEnd(System::Object^ sender, System::EventArgs^ e) { if […]

Read More

Events General

Events allow a class user to define their own function to be called when an event happens. How To Create In the public area of the class definitions: event EventHandler^ TickEvent; In the function of the class that you want to call the users function: TickEvent(this, gcnew EventArgs()); In the users code: dmxSendTimer->TickEvent += gcnew […]

Read More

Function For Multiple Form Objects – What Object Called An Event?

You can assign the same event to multiple controls. When called the "object sender" portion will be a reference to whatever one of the controls was clicked. The EventArgs portion is a way to pass extra information to the event handler. Some events use a derivative of EventArgs which contain extra information. The function will […]

Read More