Hallo okruegel,
okruegel schrieb:
Zitat: |  |
Also das mit dem Flexgrid ist schon Super. Kann man beim Flexgrid auch Zeilen markieren? 3 Stück zb.?
|  |
Ja, ich habe den Code mal angepasst:
Private Info$()
Private Sub Form_Load()
Dim i&, j&, Zeit%, Von&, Bis&
Zeit = 0
Randomize
With MSFlexGrid1
.Redraw = False
.BackColor = RGB(200, 200, 255)
.Rows = 74
.Cols = 32
ReDim Info(.Rows - 1, .Cols - 1)
.HighLight = flexHighlightWithFocus
.FixedRows = 1
.FixedCols = 1
.ScrollBars = flexScrollBarBoth
.ScrollTrack = True
.BackColorFixed = RGB(36, 53, 81)
.ForeColorFixed = RGB(212, 212, 223)
.GridColor = RGB(90, 96, 132)
For i = .FixedRows To .Rows - 1 Step 2
.Row = i
.Col = 0
.CellFontSize = 12
.Text = CStr(Zeit) & ":00"
Zeit = (Zeit + 1) Mod 24
Next i
For i = .FixedCols To .Cols - 1
.Row = 0
.Col = i
.CellBackColor = RGB(192, 192, 208)
.CellForeColor = RGB(85, 61, 69)
.CellAlignment = flexAlignCenterCenter
.Text = "Bahn" & Str(i)
Von = .FixedRows + Int(Rnd * 48)
Bis = Von + Int(Rnd * 60)
If Bis > .Rows - 1 Then Bis = .Rows - 1
.TextMatrix(Von, i) = "Spieler" & Str(i)
.Row = Von
.Col = i
.CellForeColor = RGB(200, 200, 200)
.RowSel = Bis
.ColSel = i
.FillStyle = flexFillRepeat
.CellBackColor = QBColor(1 + (1 + i) Mod 15)
.FillStyle = flexFillSingle
For j = .FixedRows To .Rows - 1
Info(j, i) = "Info:" & Str(j) & " \" & Str(i)
Next j
Next i
.Row = .FixedRows
.Col = .FixedCols
.Redraw = True
End With
End Sub
Private Sub MSFlexGrid1_MouseMove(Button As Integer, Shift As Integer, x As _
Single, y As Single)
MSFlexGrid1.ToolTipText = Info(MSFlexGrid1.MouseRow, MSFlexGrid1.MouseCol)
End Sub
Private Sub MSFlexGrid1_MouseUp(Button As Integer, Shift As Integer, x As _
Single, y As Single)
With MSFlexGrid1
MsgBox .TextMatrix(0, .Col) & vbCr & "Von Zeile:" & _
.Row & vbCr & "Bis Zeile: " & .RowSel
End With
End Sub okruegel schrieb:
Zitat: |  |
Und kann ich anstatt Die cellen farbig zumarkieren auch ein Label drauf posionieren?
|  |
Nein, das geht mit Labels nicht, weil es keine Fenster sind
und weil das Flexgrid kein Container ist. Macht aber auch
keinen Sinn, weil eine Flexgridzelle alle Funktionen eines
Labels hat, außer der Tag-Eigenschaft. Die kann man aber
durch ein String-Array ersetzen. Ich habe das mal im Code
eingebaut. Was bei den Labels die Tag-Eigenschaft war, ist
jetzt das Array Info.
Gruss,
Zardoz |