With beautiful VB6, I have some trials to edit something like invoice, I found Data grid not familiar to edit tables, also Flex grid has no method to edit. Now I create my ActiveX control using ( Show
BackgroundWhen using my ActiveX control ( Method/PropertyDefinitionExample
Set combo box at any column: VB6Flexgrid1.CellType 3, True VB6Flexgrid1.ComboClear 3 VB6Flexgrid1.ComboAddItem 3, „Visual Studio" ' add item to this combo 0for the cell (row, col) Set combo box at any column: VB6Flexgrid1.CellType 3, True VB6Flexgrid1.ComboClear 3 VB6Flexgrid1.ComboAddItem 3, „Visual Studio" ' add item to this combo 1 Set combo box at any column: VB6Flexgrid1.CellType 3, True VB6Flexgrid1.ComboClear 3 VB6Flexgrid1.ComboAddItem 3, „Visual Studio" ' add item to this combo 2Let Set combo box at any column: VB6Flexgrid1.CellType 3, True VB6Flexgrid1.ComboClear 3 VB6Flexgrid1.ComboAddItem 3, „Visual Studio" ' add item to this combo 3include combo box if Set combo box at any column: VB6Flexgrid1.CellType 3, True VB6Flexgrid1.ComboClear 3 VB6Flexgrid1.ComboAddItem 3, „Visual Studio" ' add item to this combo 4 Set combo box at any column: VB6Flexgrid1.CellType 3, True VB6Flexgrid1.ComboClear 3 VB6Flexgrid1.ComboAddItem 3, „Visual Studio" ' add item to this combo 5 Set combo box at any column: VB6Flexgrid1.CellType 3, True VB6Flexgrid1.ComboClear 3 VB6Flexgrid1.ComboAddItem 3, „Visual Studio" ' add item to this combo 6Clear combo box Set combo box at any column: VB6Flexgrid1.CellType 3, True VB6Flexgrid1.ComboClear 3 VB6Flexgrid1.ComboAddItem 3, „Visual Studio" ' add item to this combo 7 Set combo box at any column: VB6Flexgrid1.CellType 3, True VB6Flexgrid1.ComboClear 3 VB6Flexgrid1.ComboAddItem 3, „Visual Studio" ' add item to this combo 8Add item to combo box Set combo box at any column: VB6Flexgrid1.CellType 3, True VB6Flexgrid1.ComboClear 3 VB6Flexgrid1.ComboAddItem 3, „Visual Studio" ' add item to this combo 9 VB6Flexgrid1.TextMatrix(2, 3) = „VB6" ' Read any cell: DimstrCellAs String strCell = VB6Flexgrid1. TextMatrix(3, 2) 0Delete current row VB6Flexgrid1.TextMatrix(2, 3) = „VB6" ' Read any cell: DimstrCellAs String strCell = VB6Flexgrid1. TextMatrix(3, 2) 1 VB6Flexgrid1.TextMatrix(2, 3) = „VB6" ' Read any cell: DimstrCellAs String strCell = VB6Flexgrid1. TextMatrix(3, 2) 2Clear the grid VB6Flexgrid1.TextMatrix(2, 3) = „VB6" ' Read any cell: DimstrCellAs String strCell = VB6Flexgrid1. TextMatrix(3, 2) 3 To use my ActiveX (
Using the CodeAbout columns: VB6Flexgrid1.FixedCols = 0 VB6Flexgrid1.Cols = 5 VB6Flexgrid1.ColWidth(1) = 1500 VB6Flexgrid1.ColAlignmentHeader(1) = flexAlignCenterCenter VB6Flexgrid1.ColAlignment(1) = flexAlignLeftCenter About combo box: Set combo box at any column: VB6Flexgrid1.CellType 3, True VB6Flexgrid1.ComboClear 3 VB6Flexgrid1.ComboAddItem 3, „Visual Studio" ' add item to this combo About cell: VB6Flexgrid1.TextMatrix(2, 3) = „VB6" ' Read any cell: DimstrCellAs String strCell = VB6Flexgrid1. TextMatrix(3, 2) You can go back to source files of the project ( RemarksWhen extracting the file VBFlexGrid.zip, you can find the file: ..\VBFlexGrid\ActiveXcontrol\VB6Flexgrid.ocx, find the project to test the ActiveX control in the folder: ..\ VBFlexGrid. This project has three forms:
VB6Flexgrid1.TextMatrix(2, 3) = „VB6" ' Read any cell: DimstrCellAs String strCell = VB6Flexgrid1. TextMatrix(3, 2) 9and `MSFlexGrid`0have the same controls:
Last WordsI hope this article is useful and helps you to create your applications. If you have any ideas or if you find any problems, please tell me. Thanks to CodeProject and thanks to all. -- Mostafa Kaisoun This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming. How to use MSFlexGrid in VB6?Add the MSFlexGrid control to your project:. Go to the Project menu, pick Components.. Scroll down the list of components until you find "Microsoft FlexGrid Control 6.0 (sp3)". Select that checkbox and hit the OK button to add the control to your project.. How to add DataGrid in VB6?To add the DataGrid control, click on the project on the menu bar and select components to access the dialog box that displays all the available VB6 components, as shown in the diagram below. Select Microsoft DataGrid Control 6.0 by clicking the checkbox beside this item. What is flex grid control in VB?MSFlexGrid control in VB is used to create applications that present information in rows and columns.Information is displayed in cells. How to edit data in DataGrid in VB6 0?firstly ,Data Grid control and Adodc are not available on toolbox.So add these controls to form for use. Next make the database connectivity using Adodc. ... . Once data is shown on the form,then set the datagrid property for adding ,deleting and updating the records.. Add search capability to the datagrid.. |