Free Programming Books
Free download ebooks on computer and programming | |||
Free ebook "Visual Basic and Visual Basic .NET for Scientists and Engineers" Sample Chapter
VB and VB .NET for Scientists......
Download chapter
Free download chapter 9: Programming Your Own Spreadsheets Visual Basic and Visual Basic .NET for Scientists and Engineers begins with an overview of the Visual Basic and Visual Basic .NET IDEs, their important characteristics, and how the development environments can be manipulated to suit developers' needs. After a solid discussion of VB and VB .NET forms, controls, and namespaces, author Christopher Frenz shows you how to put controls to work by making use of the different control events. Programming Your Own SpreadsheetsIN THIS CHAPTER, YOU'LL LEARN how to code the spreadsheet-type interfaces that are common to so many scientific applications. These interfaces are extremely useful when dealing with matrix math or other scenarios that require a large amount of data. To develop such an advanced interface, this chapter introduces a new control along with some user events you haven't yet encountered. The examples require you to use almost everything you've seen so far, so make sure that you have the basics covered. The MSFlexGrid ControlThe MSFlexGrid control, when it's displayed on a form, appears like any spreadsheet grid. It consists of a number of intersecting rows and columns, and the points where the rows and columns intersect are known as cells. If you add such a control to your form and click Run, you'll see that it behaves almost like a spreadsheet program's worksheet. For example, you can move between cells with the arrow keys and mouse. The only real difference between this control and an actual spreadsheet is that you can't enter (type) data directly into a grid cell. Thus, this chapter will concentrate on coding a way to allow direct user data entry. But first, take some time to examine the important properties and events associated with this control. The MSFlexGrid control isn't a part of the standard VB toolbox. In VB 6.0, you must go to the Project menu and select the Components option. You then select the MSFlexGrid control from the Components list. In VB .NET you have to go to the Tools menu and select the Customize Toolbox option. You next select the MSFlexGrid control from the COM controls list. The control icon then appears in the toolbox, where you can drag and drop it onto a form as with any other control. | |||