943,862 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Oct 25th, 2008
0

Text collect from MSflexgrid to textbox

Expand Post »
I have 4 text box in a form. when I click a button another Form show with a MSflexgrid. when I click in a msflexgrid the data show a text box of another form. I write code:
form1.Text1.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, MSFlexGrid1.ColSel)

But I when I click msflexgrid the same data show all 4 textbox. But I want 4 item of data in msflexgrid show in 4 text box separetly . please help me.
Reputation Points: 14
Solved Threads: 78
Practically a Posting Shark
abu taher is offline Offline
835 posts
since Jul 2008
Oct 28th, 2008
0

Re: Text collect from MSflexgrid to textbox

any one can help me please
Reputation Points: 14
Solved Threads: 78
Practically a Posting Shark
abu taher is offline Offline
835 posts
since Jul 2008
Oct 28th, 2008
0

Re: Text collect from MSflexgrid to textbox

If the remaining cells are the adjacent to each other, you can hardcode the column numbers!


Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. form1.Text1.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, 0) 'For data in Column 0
  2. form1.Text2.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, 1) 'For data in Column 1
  3. form1.Text3.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, 2) 'For data in Column 2
  4. form1.Text4.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, 3) 'For data in Column 3

The row is constant for the row u have selected. only change the columns.

Regards
Shaik Akthar
Last edited by aktharshaik; Oct 28th, 2008 at 5:52 am.
Reputation Points: 26
Solved Threads: 40
Posting Whiz
aktharshaik is offline Offline
316 posts
since Aug 2008
Oct 28th, 2008
0

Re: Text collect from MSflexgrid to textbox

its not work.
Reputation Points: 14
Solved Threads: 78
Practically a Posting Shark
abu taher is offline Offline
835 posts
since Jul 2008
Oct 28th, 2008
0

Re: Text collect from MSflexgrid to textbox

sorry it works
Reputation Points: 14
Solved Threads: 78
Practically a Posting Shark
abu taher is offline Offline
835 posts
since Jul 2008
Oct 28th, 2008
0

Re: Text collect from MSflexgrid to textbox

Can u attach the three forms?
Reputation Points: 26
Solved Threads: 40
Posting Whiz
aktharshaik is offline Offline
316 posts
since Aug 2008
Oct 28th, 2008
0

Re: Text collect from MSflexgrid to textbox

don't mind. If the remaining cells are not the adjacent to each other and I want click separatly each cell for each text then what I write. Please ........
Reputation Points: 14
Solved Threads: 78
Practically a Posting Shark
abu taher is offline Offline
835 posts
since Jul 2008
Oct 28th, 2008
0

Re: Text collect from MSflexgrid to textbox

Use Select Case

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1.  
  2. Select Case MSFlexGrid1.ColSel
  3. Case 0:
  4. form1.Text1.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, MSFlexGrid1.ColSel)
  5. goto Label1
  6. Case 1:
  7. form1.Text2.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, MSFlexGrid1.ColSel)
  8. goto Label1
  9. Case 2:
  10. form1.Text3.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, MSFlexGrid1.ColSel)
  11. goto Label1
  12. Case 3:
  13. form1.Text4.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, MSFlexGrid1.ColSel)
  14. goto Label1
  15. End Select
  16.  
  17. Label1:


Regards
Shaik Akthar
Last edited by aktharshaik; Oct 28th, 2008 at 6:14 am.
Reputation Points: 26
Solved Threads: 40
Posting Whiz
aktharshaik is offline Offline
316 posts
since Aug 2008
Oct 28th, 2008
0

Re: Text collect from MSflexgrid to textbox

label1 mean?
Reputation Points: 14
Solved Threads: 78
Practically a Posting Shark
abu taher is offline Offline
835 posts
since Jul 2008
Oct 29th, 2008
0

Re: Text collect from MSflexgrid to textbox

I have just put a label outside the select case BLOCK to transfer the control outside of the select block once any case is executed. but it is not mandatory. YOU CAN OMIT THE GOTO STATEMENT



Regards
Shaik Akthar
Last edited by aktharshaik; Oct 29th, 2008 at 1:59 am.
Reputation Points: 26
Solved Threads: 40
Posting Whiz
aktharshaik is offline Offline
316 posts
since Aug 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Visual Basic 6.0
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Comparing list boxes and alert the users





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC