Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Editable Flexigrid

Posted on 2001-08-10
9
Medium Priority
?
848 Views
Last Modified: 2008-03-17
Hi

I want to make the Microsoft Flexigrid editable. I read somewhere that it is possible. If someone knows, please let me know. It is urgent.

Thanks
hmnpa
0
Comment
Question by:hmnpa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 14

Expert Comment

by:wsh2
ID: 6373723
Urgent?

Questions Asked 26
Last 10 Grades Given A A B A A A B A A B  
Question Grading Record 13 Answers Graded / 13 Answers Received
Answers  
Questions Answered 0

13 Open questions dating back to at least October of last year. PLEASE tend to them (add a comment to get them going.. grade.. or delete them) before I give you an answer here.

0
 
LVL 3

Accepted Solution

by:
andysalih earned 160 total points
ID: 6374752
will allow users to edit flexi grid, hope its what you want



Private Sub MyFlexGrid_KeyPress(KeyAscii As Integer)
    'Provides manual data entry capability t
    '     o flexgrid


    With MyFlexGrid


        Select Case KeyAscii
            Case vbKeyReturn


            If .Col + 1 <= .Cols - 1 Then
                .Col = .Cols - 1
            ElseIf .Row + 1 <= .Rows - 1 Then
                .Row = .Row + 1
                .Col = 0
            Else
                .Row = 1
                .Col = 0
            End If
            Case vbKeyBack


            If Trim(.Text) <> "" Then
                .Text = Mid(.Text, 1, Len(.Text) - 1)
            End If
            Case Is < 32
            Case Else


            If .Col = 0 Or .Row = 0 Then
                Exit Sub
            Else
                .Text = .Text & Chr(KeyAscii)
            End If
        End Select
End With
End Sub


cheers
Andy
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:andysalih
ID: 6374762
ps, if the code i have submitted works for you then please dont leave this question unattended like wsh2 has stated.

let me also give you some friendly advice "if you dont reward points to previous questions you have asked, experts tend not to answer you question."

example....
wsh2's comment.



i don't blame him but i will give you the benefit of the dout.

cheers
Andy

0
 
LVL 3

Expert Comment

by:andysalih
ID: 6374769
also there is a program you can download, full source code,

http://www.planetsourcecode.com/xq/ASP/txtCodeId.23425/lngWId.1/qx/vb/scripts/ShowCode.htm


that may help you

cheers
Andy
0
 

Author Comment

by:hmnpa
ID: 6374770
Thanks Andy

I have been careless. Sorry for that. I have resolved all the previous questions.
0
 
LVL 14

Expert Comment

by:wsh2
ID: 6374796
1. Start a New Standard.Exe Project.
2. Add 1 "Microsoft Flex Grid" (MSFlexGrid1) to Form1.
3. Add 1 TextBox (Text1) to Form1.
4. Copy/Paste the following into the Form1 code window.
5. Press F5 to Run. Type what you want into the FlexGrid. Use the arrow keys to navigate.

<----- Code Begin ----->

Option Explicit

Dim m_intDirection As Integer

Private Sub Form_Load()
   
   Form1.Move _
      Screen.Width * 0.1, _
      Screen.Height * 0.1, _
      Screen.Width * 0.8, _
      Screen.Height * 0.8
   
   With MSFlexGrid1
      .Cols = 10
      .Rows = 10
      .ScrollTrack = True
   End With
   
   With Text1
      .Text = ""
      .FontBold = True
   End With
   
End Sub

Private Sub Form_Resize()

   MSFlexGrid1.Move 0, 0, ScaleWidth, ScaleHeight
   With MSFlexGrid1
      Text1.Move .CellLeft - 30, .CellTop - 30, .CellWidth + 30, .CellHeight
      Text1.ZOrder 0
   End With
   
End Sub

Private Sub MSFlexGrid1_GotFocus()

   Call MSFlexGrid1_RowColChange

End Sub

Private Sub MSFlexGrid1_RowColChange()

   With MSFlexGrid1
      Text1.Move .CellLeft - 30, .CellTop - 30, .CellWidth + 30, .CellHeight
      Text1.Text = .TextMatrix(.Row, .Col)
      Text1.SelStart = 0
      Text1.SelLength = Len(Text1.Text)
      Text1.SetFocus
   End With

End Sub

Private Sub Text1_Change()

   With MSFlexGrid1
      .TextMatrix(.Row, .Col) = Text1.Text
   End With

End Sub

Private Sub Text1_Keyup(KeyCode As Integer, Shift As Integer)

   Dim intDirection As Integer

   Select Case KeyCode
      Case vbKeyDown
         intDirection = 1
      Case vbKeyUp
         intDirection = 2
      Case vbKeyReturn
         intDirection = m_intDirection
      Case vbKeyRight
         intDirection = 3
      Case vbKeyLeft
         intDirection = 4
   End Select
   
   With MSFlexGrid1
      Select Case intDirection
         Case 1 ' Down
            m_intDirection = intDirection
            If .Row + 1 >= .Rows Then
               .Row = .FixedRows
            Else
               .Row = .Row + 1
            End If
         Case 2 ' Up
            m_intDirection = intDirection
            If .Row - 1 < .FixedRows Then
               .Row = .Rows - 1
            Else
               .Row = .Row - 1
            End If
         Case 3 ' Right
            m_intDirection = intDirection
            If .Col + 1 >= .Cols Then
               .Col = .FixedCols
            Else
               .Col = .Col + 1
            End If
         Case 4 ' Left
            m_intDirection = intDirection
            If .Col - 1 < .FixedCols Then
               .Col = .Cols - 1
            Else
               .Col = .Col - 1
            End If
      End Select
   End With

End Sub

<----- Code End ----->


0
 

Author Comment

by:hmnpa
ID: 6378742
Thanks Andy

You have been a great help. WSH2's answer is also a good one, but since you were the first to answer, and you also were so kind, I am giving the points to you.

Thanks very much
hmnpa
0
 
LVL 3

Expert Comment

by:andysalih
ID: 6384327
your very welcome hmnpa.



ps. hey WSH2, just got in first, just in the nip of time

lol

:op

andy
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question