Easily Add MSHFlexGrid in Toolbox and Set properties in VB6

MSHFlexGrid provide complete usability to add, edit, delete, sort data with image. So, SKOTechLearn will teach you about add MSHFlexGrid in Toolbox and set Properties in VB6.0 application. But, first we learn, what the difference between Listview and MSHFlexGrid?

Difference between Listview and MSHFlexGrid:

➤ The main advantage of this component to allows any column’s Font name change. You can change every column with different font name.

➤ And the other advantage of using this component is to allow Google Input Tools string like: (Google Input Hindi, Google Input Greek, Google Input Russia etc.). But if insert Google input string to Listview, it will show as Question Mark “?”.

➤ This provide more attractive look than Listview. In This control, it can change Column Header background color and Forecolor according to user choice.

➤ You can also copy all cells value and paste directly in Excel sheet. There is no need to export in Excel.

But, for beginners to understand where to find this component and add this to Toolbox?

Set Column width, Color, Font and Grid style in MSHFlexGrid in VB6.0


Add MSHFlexGrid Component in ToolBox:

In Microsoft Visual Basic 6.0, search "Microsoft Hierarchical FlexGrid Control 6.0 (OLEDB)" option from "Controls" tab of "Components" box, then press "OK" or "Apply" button.

To add This control to project, follow the Steps:

Project >> Components >> Controls (Tab) >> Microsoft Hierarchical FlexGrid Control 6.0 (OLEDB)
Component add MSHFlexGrid in Toolbox
Add Component in Toolbox
For adding this control to Project’s Form, Click on this control's Icon from 'Toolbox'. And draw it to Project’s Form. For add any control from Toolbox to Form, Just apply click and draw process.

Tips to Show Database Record in MSHFlexGrid through ADODC in vb6.0

MSHFlexGrid Properties Settings:

Now, let’s go to properties setting of this control.

1.
Right Click on it and find "Properties.." option and click on it, a 'Property Pages' window will appear.

2.
You will find that there is different type of tab contain (General, Band, Style, Font, Color, Picture). We will generally change settings of General, Style, Color and Picture Tab.

3.
Mainly we setting in General tab for Header, scrolling, row selecting or column width.

Properties Settings in MSHFlexGrid
Properties Settings

Adjust Column and Rows Number:


4.
From 'Property Pages' window, go to 'General' tab and go to 'Rows:' Textbox for increase or decrease row cell.

5.
Go to 'Column:' Textbox for increase or decrease Column cell. You can also adjust Fixed Rows and Columns like it.

6.
Just go to 'Fixed Rows:' Textbox and input row number and go to 'Fixed Cols:' Textbox and input column number according to requirement.

Easy way to Edit or Delete Selected Item of MSHFlexGrid in vb6.0

Suppose, we set rows and Columns like bellow.
Rows: 2 Fixed Rows: 1
Column: 5 Fixed Cols: 0

Rows and Columns Looks Like bellow:

You can see that in this way where you can design grid through settings up Rows and Columns in MSHFlexGrid control.

Also Learn..

ADO Data Control (ADODC) component in VB

This is the advance tips to Add MSHFlexGrid in Toolbox and set MSHFlexGrid Properties in VB6.0 with SKOTechLearn.

2 comments:

  1. Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! click here to find out more

    ReplyDelete