Adding A Flex Grid Control To A Program
The Program Design Department is calling. Can you whip up a program to display a few tables of data? No problem, you say, I_will use the Microsoft flex grid control. They ask, and how about spreadsheets? You say, no problem_flex grids can handle that too. You can add a flex grid to a Visual Basic project easily; just follow these steps:
1. Select the Project[vbar]Components menu item.
2. Click the Controls tab in the Components dialog box.
3. Select the Microsoft FlexGrid Control entry in the Components dialog box.
4. Close the Components dialog box by clicking on OK. This displays the Flex Grid Control tool in the toolbox.
5. Add a flex grid control to your form in the usual way for Visual Basic controls, using the Flex Grid Control tool.
6. Set the flex grid_s Rows and Cols properties to the number of rows and columns you want in your flex grid. You can also customize your flex grid by setting such properties as BorderStyle, ForeColor, BackColor, and so on.
This gives you a blank flex grid control in your program; the next step is to fill it with data. To start doing that, take a look at the next topic in this chapter.
TIP: When you insert a flex grid, you can also connect it to a database. To do this, you create a new data control (it_s an intrinsic Visual Basic control and appears in the toolbox when you start Visual Basic), connect that control to the database (by setting its DatabaseName and RecordSource properties), then set the flex grid_s DataSource property to the name of the data control. We_ll see more about connecting to a database when we discuss the data-bound Visual Basic controls. (See _Connecting A Flex Grid To A Database_ later in this chapter.)
Saturday, December 26, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment