I now have a Windows 7 pc (64 bit version) and have installed Visual Basic 5. (Enterprise edition)
I can run programs compiled with Windows XP on the Windows 7 pc.
If I try to load the file code that uses the 'Microsodt Internet' control
into Visual basic on on Windows 7 then I get the following errors:
Error accessing the system registrey
Errors during load. Refer to ...
Line ..: Class SHDocVwCtl.WebBrowser of control WebBrowser1 was not a loaded control class.
Windows XP references:
Microsoft Internet Controls = C:\WINDOWS\system32\ieframe.oca
Windows XP components:
Microsoft Internet Controls = C:\WINDOWS\system32\SHDOCVW.dll
Windows 7 references:
Microsoft Internet Controls = C:\Windows\SysWOW64\ieframe.dll
Windows 7 components:
Microsoft Internet Controls = C:\Windows\SysWOW64\ieframe.dll
If I try to point Microsoft Internet Controls to a different file I get the error
The file 'C:\Windows\System32\shdocvw.dll' was not registered as an ActiveX component.
Don't spend too much time on your computer.
Sit on a chair instead!!
It's a lot more comfortable and better for your hardware. :-/
This works on Windows 7: (running as Administrator, that is)
Code:
Option Explicit
' Flexgrid Alignment Constants
' ----------------------------
' flexAlignLeftTop 0
' flexAlignLeftCenter 1
' flexAlignLeftBottom 2
' flexAlignCenterTop 3
' flexAlignCenterCenter 4
' flexAlignCenterBottom 5
' flexAlignRightTop 6
' flexAlignRightCenter 7
' flexAlignRightBottom 8
' flexAlignGeneral 9
' .AllowBigSelection = True
' .SelectionMode = flexSelectionByRow
'
' .Col = .ColSel ' =========
' .Row = .FixedRows ' Select Row
' .RowSel = .Rows - 1 ' =========
Public m_iSortCol As Integer, m_iSortType As Integer
Private Sub Form_Activate()
Dim DayName(4) As String
Dim st As String
Dim x%
With MSFlexGrid1
.CellAlignment = flexAlignRightTop ' Align all cells
.Clear
.WordWrap = True
.Rows = 10
.Cols = 7
.FixedRows = 2
.RowHeight(2) = 600
st = " "
For x = 2 To 6 ' Load Day Names (0=Sunday)
st = st & "|<" & Format(Day(Now) + x, " d") & " "
Next x
For x = 1 To 5 ' This adds the second header
.TextMatrix(1, x) = Format(x + 1, "ddd")
Next x
.FormatString = st ' Deploy Heading
st = "; " ' Signify Row Headings with ";"
For x = 0 To 7
If x = 0 Then
st = st & "| "
Else
st = st & "| Level " & x
End If
Next x
.FormatString = st ' Deploy Columns
.TextMatrix(2, 1) = "*" & vbCrLf & "1" ' Fill column 1 row 1
.CellForeColor = vbWhite
.CellBackColor = vbBlue
.CellAlignment = flexAlignCenterCenter ' Override one above
.TextMatrix(2, 2) = "2" ' Fill column 1 row 1
.TextMatrix(2, 3) = "3" ' Fill column 1 row 1
.TextMatrix(3, 1) = "2" & vbCrLf & "1" ' Fill column 1 row 1
.TextMatrix(3, 2) = "3" ' Fill column 1 row 1
.TextMatrix(3, 3) = "1" ' Fill column 1 row 1
.ColWidth(6) = 1000
.RowHeight(1) = 600
.Row = 2
.Col = 6
.CellAlignment = flexAlignCenterBottom
.ForeColor = vbRed
.Text = "Hello"
Set .CellPicture = LoadPicture(App.Path & "\beany.bmp")
.CellPictureAlignment = flexAlignRightCenter
End With
End Sub
'Private Sub MSFlexGrid1_Click()
' MSFlexGrid1.ColWidth(MSFlexGrid1.Col) = MSFlexGrid1.ColWidth(MSFlexGrid1.Col) + 20
' MsgBox "Row: " & MSFlexGrid1.MouseRow & " Col: " & MSFlexGrid1.MouseCol
'End Sub
Private Sub MSFlexGrid1_DblClick()
Dim i As Integer
' sort only when a fixed row is clicked
If MSFlexGrid1.MouseRow >= MSFlexGrid1.FixedRows Then Exit Sub
i = m_iSortCol ' save old column
m_iSortCol = MSFlexGrid1.Col ' set new column
' increment sort type
If i <> m_iSortCol Then
' if clicking on a new column, start with ascending sort
m_iSortType = 1
Else
' if clicking on the same column, toggle between ascending and descending sort
m_iSortType = m_iSortType + 1
If m_iSortType = 3 Then m_iSortType = 1
End If
DoColumnSort
End Sub
Sub DoColumnSort()
With MSFlexGrid1
.Redraw = False
.Row = 1
.RowSel = .Rows - 1
.Col = m_iSortCol
.Sort = m_iSortType
.Redraw = True
End With
End Sub
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.