| |

VerySource

 Forgot password?
 Register
Search
View: 728|Reply: 4

MSHFlexGrid data entry (data transfer)!

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-2-21 18:30:01
| Show all posts |Read mode
I want to double-click a cell in a column in the MSHFlexGrid of the first form, the second form pops up instead of the DataGrid (because I need to select a lot of data, and it is divided into several levels, I am in the second This form uses TreeView and TextBox to implement this form, of course this form and TreeView have already been built), I would like to ask how to select the right TextBox after the second form selects the data node to be added The data shown in the figure can be entered into the corresponding cells of MSHFlexGrid in the first form after clicking the "OK" button.
    I have checked on the Internet that passing variables between forms is generally implemented through global variables or public members of the form, but I still do n’t understand how to achieve this.
    Please master one or two! It's better to have code! Thank you!
Reply

Use magic Report

0

Threads

14

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

Post time: 2020-5-4 13:15:01
| Show all posts
Private Sub Command1_Click ()
    Form1.MSHFlexGrid1.TextMatrix (2, 2) = Text1.Text
    Unload Me
End Sub
Reply

Use magic Report

0

Threads

14

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

Post time: 2020-5-4 13:30:01
| Show all posts
The above is in Form2
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-5-6 23:45:01
| Show all posts
I have done this, but there are multiple TextBoxes in Form2, and after entering one row in the MSHFlexGrid of Form1, I must continue to enter the second row and the third row ... (supplement: I am doing a small product storage system , Multiple data must be entered for a warehouse receipt), because I have merged a few columns, then an error will occur, the first and second rows will be merged into one cell regardless of the same or different content. "Passing variables between Forms is generally achieved through global variables or public members of the form" How to do it specifically?
Reply

Use magic Report

0

Threads

16

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

Post time: 2020-6-21 23:30:02
| Show all posts
Even method, this is relatively simple and fast. This is how I transfer data between windows. Using global variables is more troublesome if you define more parameters, so you can get a clear correspondence!

''Input parameters
Private Sub MnuInput_Click()
With MSHFlexGrid1
''Product model and itinerary description
     Form1.Text84.Text = .TextMatrix(1, 2)
     Form1.Text81.Text = .TextMatrix(2, 2)
     Form1.Text20.Text = .TextMatrix(3, 2)
     Form1.Text82.Text = .TextMatrix(4, 2)
     Form1.Text83.Text = .TextMatrix(5, 2)

'' input parameters
     Form1.Text1.Text = .TextMatrix(8, 2)
     Form1.Text2.Text = .TextMatrix(9, 2)
     Form1.Text3.Text = .TextMatrix(10, 2)
     Form1.Text4.Text = .TextMatrix(11, 2)
     Form1.Text5.Text = .TextMatrix(12, 2)
     Form1.Text6.Text = .TextMatrix(13, 2)
     Form1.Text7.Text = .TextMatrix(14, 2)
     Form1.Text8.Text = .TextMatrix(15, 2)
     Form1.Text9.Text = .TextMatrix(16, 2)
     
'' Bucket input parameters
     
''Mechanical parameter input


End With
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list