Testing the IconButton Control

function OpenWin(url, w, h) { if(!w) w = 400; if(!h) h = 300; window.open(url, "_new", "width=" + w + ",height=" + h + ",menubar=no,toobar=no,scrollbars=yes", true); }

Testing the IconButton Control

Testing the IconButton is as simple as creating a new Windows Forms project and customizing the Toolbox to display the IconButton. Create a new Windows Forms project and then right-click on the Toolbox to bring up the context menu shown in Figure 2.8, and select Customize Toolbox. This brings up the Customize Toolbox dialog, which you can use to browse for the compiled DLL created for the IconButton (see Figure 2.9).

Figure 2.8. The Toolbox context menu.

figure 2.8. the toolbox context menu.

Figure 2.9. The Customize Toolbox dialog.

figure 2.9. the customize toolbox dialog.

Click OK and a Toolbox item for the IconButton appears at the bottom of the Windows Forms tab. As with any other controls, select the IconButton and drag it onto the form. With the IconButton selected, use the property browser to assign an icon to the button. Notice that a dialog appears and that when an icon file is selected, the property browser is updated and the control renders the icon. How does this happen? Well, this is the subject of the next chapter.



    .NET Windows Forms Custom Controls
    User Interfaces in VB .NET: Windows Forms and Custom Controls
    ISBN: 1590590449
    EAN: 2147483647
    Year: 2002
    Pages: 74

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net