Solved

Editable Flexigrid

Posted on 2001-08-10
9
836 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 69

Expert Comment

by:Éric Moreau
Comment Utility
0
 
LVL 14

Expert Comment

by:wsh2
Comment Utility
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 40 total points
Comment Utility
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
 
LVL 3

Expert Comment

by:andysalih
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 3

Expert Comment

by:andysalih
Comment Utility
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
Comment Utility
Thanks Andy

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

Expert Comment

by:wsh2
Comment Utility
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
Comment Utility
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
Comment Utility
your very welcome hmnpa.



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

lol

:op

andy
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now