True DBGrid 4.0
Private Sub TDBGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
' Test if row change
If TDBGrid1.Bookmark <> LastRow Then
' Select current record by adding its bookmark to the SelBookmarks collection
TDBGrid1.SelBookmarks.Add TDBGrid1.Bookmark
End If
End Sub
The full-featured retail version, True DBGrid 4.0, supports the MarqueeStyle property.
Sub Table1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
If form1.ActiveControl.Tag = "table2" And table2.EditActive = True Then
table2.EditActive = False
End If
End Sub
Sub Table2_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
If form1.ActiveControl.Tag = "table1" And table1.EditActive = True Then
table1.EditActive = False
End If
End Sub
You will need to set each grid's Tag property as they are not set by default.
Note : The following two questions have been answered by APEX Technical Support of the APEX Software Corporation. You can email them at : support@apexsc.com.
TDBGrid1.Columns(1).Width = Single
This property returns or sets the width of a column in terms of the coordinate system of the grid's container.
If you want the user to be able to size columns at runtime you will have to set the AllowSizing property of the grid to True(which is the default). When they move the mousepointer to the column divider line in the header it will turn to two arrows and they can click and hold the left mouse button to drag the column either larger or smaller.
sub grid1_aftercolupdate( byval colindex as integer)
grid1.columns(1).text = <value 1>
grid1.columns(2).text = <value 2>
end sub
The above syntax works well with True DBGrid Standard (1.0.0106) but does not work with DBGrid (1.0.086). Also GPFs occur when the data control is refreshed in both scenarios.
If you are using the DBGrid which ships with Visual Basic 4.0 we recommend that you upgrade to True DBGrid Standard. True DBGrid Standard is a free upgrade to DBGrid and was written to add a few powerful features to DBGrid, fix critical errors discovered by users of DBGrid, and to provide users with full on-line documentation and tutorial projects. True DBGrid Standard also comes with a migration utility add-in which will allow you to easily convert an existing application which uses DBGrid to use True DBGrid Standard instead.
The latest version of True DBGrid Standard can be downloaded from CompuServe, Anonymous FTP site or WWW page.
Instructions for downloading the appropriate file:
Downloading Instructions for: True DBGrid Standard Full Version
Anonymous FTP Server:ftp.apexsc.com
When you log in, and are prompted for a user name, type "anonymous" and then
type in your e-mail address as your password. You can find the file in the
/pub/ocx directory.
World Wide Web: www.apexsc.com
Click on the "True DBGrid Standard Latest Version" link on our home page.
Then click on the appropriate icon to download either the 16 or 32 bit
version. Be sure to download the "Full Version" if you do not already have
True DBGrid Standard on your system.
CompuServe: go apex
Search our forum library (COMPA forum, APEX library) for the files you need and
download them.
Notes:
The file(s) are self-extracting archive files. Just place the file in a
temporary directory and run it. It will extract all of the appropriate files
and install True DBGrid Standard.
I suggest you try this first and see if this version will help your problem.
True DBGrid Standard contains a Migration tool to convert your old DBGrid projects so they can be used with True DBGrid Standard. For more information, check the documentation included with True DBGrid Standard.