|
-
Apr 8th, 2003, 01:44 PM
#1
Thread Starter
Lively Member
How To Display Selected FlexGrid Data in a Label [RESOLVED]
Attempting to make a graphical input for form data. So I populate a 132x60 grid with data from the form. When I select/highlight I want to be able to display what I selected in a label.
So If
12345678901234567890
ABC Company
So If select cols 3 through 13. I want the label to display "ABC company" is this possible?
Last edited by scimini; Apr 8th, 2003 at 02:30 PM.
-
Apr 8th, 2003, 01:48 PM
#2
Hyperactive Member
this is similar
This is similar to what you want.
VB Code:
Private Sub Form_Load()
Dim RowIndex As Integer
Dim ColIndex As Integer
With Me.MSHFlexGrid1
For RowIndex = 0 To .Rows - 1
For ColIndex = 0 To .Cols - 1
.TextMatrix(RowIndex, ColIndex) = RowIndex + ColIndex
Next
Next
End With
End Sub
Private Sub MSHFlexGrid1_Click()
With Me.MSHFlexGrid1
If .Col > .FixedCols - 1 And .Row > .FixedRows - 1 Then
Me.txtMagnify.Text = .Text
Me.txtMagnify.Visible = True
Me.txtMagnify.Left = .Left + .CellLeft + ((.CellWidth - Me.txtMagnify.Width) / 2)
Me.txtMagnify.Top = .Top + .CellTop + ((.CellHeight - Me.txtMagnify.Width) / 2)
End If
End With
End Sub
Private Sub MSHFlexGrid1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
With Me.MSHFlexGrid1
If Me.txtMagnify.Visible = True Then
If .MouseCol <> .Col Or .MouseRow <> .Row Then
Me.txtMagnify.Visible = False
End If
End If
End With
End Sub
Private Sub txtMagnify_Click()
Me.txtMagnify.Visible = False
End Sub
Private Sub txtMagnify_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.MousePointer = vbDefault
End Sub
-
Apr 8th, 2003, 02:02 PM
#3
Thread Starter
Lively Member
Sort of, I do not need to float the textbox, it can be stationary. And where does the value of the selection get displayed. From looking at the code, it will only work one time?
-
Apr 8th, 2003, 02:04 PM
#4
Hyperactive Member
just comment out the movement code.
It reacts to the mouseclick, whatever
you click on is displayed in the textbox
-
Apr 8th, 2003, 02:08 PM
#5
Thread Starter
Lively Member
Is there a way to get it to display the entire selection and not just the cell that was clicked.
Let me explain a little better. Each Letter has its own cell. So "ABC Company" comprises 11 cells. It is basically a 1 letter to 1 cell relationship. I need to selected all 11 cells and have the characters basically combined to create the original string.
-
Apr 8th, 2003, 02:16 PM
#6
Hyperactive Member
Loop through all columns in the selected
row and place the value in the Text box
instead of the .Text property.
-
Apr 8th, 2003, 02:20 PM
#7
Thread Starter
Lively Member
The loop is the problem. I now how to find the start of the selection, how do I find the end. ColSel gives me the start, how do I find the end.
-
Apr 8th, 2003, 02:21 PM
#8
Hyperactive Member
-
Apr 8th, 2003, 02:29 PM
#9
Thread Starter
Lively Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|