Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Editable Flexigrid

Posted on 2001-08-10
9
Medium Priority
?
849 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
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

926 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