Article ID: 223073
Article Last Modified on 5/8/2003
APPLIES TO
- Microsoft Visual Basic 6.0 Learning Edition
- Microsoft Visual Basic 6.0 Professional Edition
- Microsoft Visual Basic 6.0 Enterprise Edition
This article was previously published under Q223073
SYMPTOMS
When using the Hierarchical FlexGrid control it is possible to specify a specific type of line style (dots, dashes, etc.) that the control will use as a border between cells. These line style attributes can be set using the GridLinesHeader and GridLinesIndent properties of the control.
In versions of Visual Basic prior to Visual Studio Service Pack 3, when setting these two properties to either flexGridDashes(4) or flexGridDots(5) you may not see the appropriate line styles drawn in the MSHFlexGrid control. Instead the lines will be drawn as normal lines without using the correct style attribute.
RESOLUTION
This problem with the Microsoft Hierarchical FlexGrid has been fixed. See the STATUS section below for more information.
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:
MORE INFORMATION
The code below reproduces this problem. This code uses the Northwind database (nwind.mdb) that ships with Visual Basic 6.0. You may need to change the connection string to point to your copy of the Northwind database.
- Create a new Visual Basic 6.0 Standard EXE project and add a reference to the Microsoft ActiveX Data Objects library.
- From the Project menu, choose Components and add a reference to the Microsoft Hierarchical FlexGrid Control 6.0.
- Add an Hierarchical FlexGrid and a CommandButton to the default form.
Paste the following code into the form:
Const CONNECTSTR = "Provider=MSDataShape;Data Provider=Microsoft.Jet.OLEDB.3.51;" & _ "Persist Security Info=False;Data Source=" & _ "c:\Nwind.mdb" Private Sub Command1_Click() MSHFlexGrid1.BandDisplay = flexBandDisplayVertical MSHFlexGrid1.BandIndent(1) = 2 MSHFlexGrid1.ColHeader(1) = flexColHeaderOn MSHFlexGrid1.GridColorHeader(1) = QBColor(13) '13 = light magenta (magenta = 5) MSHFlexGrid1.GridColorIndent(1) = QBColor(14) '14 = light yellow (yellow = 6) MSHFlexGrid1.GridLinesHeader(1) = flexGridDashes MSHFlexGrid1.GridLinesIndent(1) = flexGridDashes End Sub Private Sub Form_Load() Dim cn As New ADODB.Connection Dim rs As New ADODB.Recordset cn.Open CONNECTSTR rs.Open "SHAPE {SELECT OrderID,CustomerID,ShipName FROM Orders} AS Command1 " & _ "APPEND ({SELECT * FROM [Order Details]} AS Command2 " & _ "RELATE 'OrderID' TO 'OrderID')", cn Set MSHFlexGrid1.DataSource = rs End Sub
- Run the code and note the bordering lines between the cells.
If you are running Visual Basic with Visual Studio Service Pack 3 or later, this displays correctly (as dashes instead of solid lines).
REFERENCES
MSDN Library
Additional query words: SHFlexGrid display lines
Keywords: kbbug kbfix kbctrl kbvs600sp3fix KB223073