Text collect from MSflexgrid to textbox

Thread Solved

Join Date: Jul 2008
Posts: 471
Reputation: abu taher is an unknown quantity at this point 
Solved Threads: 24
abu taher's Avatar
abu taher abu taher is offline Offline
Posting Pro in Training

Text collect from MSflexgrid to textbox

 
0
  #1
Oct 25th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 471
Reputation: abu taher is an unknown quantity at this point 
Solved Threads: 24
abu taher's Avatar
abu taher abu taher is offline Offline
Posting Pro in Training

Re: Text collect from MSflexgrid to textbox

 
0
  #2
Oct 28th, 2008
any one can help me please
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 304
Reputation: aktharshaik is an unknown quantity at this point 
Solved Threads: 37
aktharshaik's Avatar
aktharshaik aktharshaik is offline Offline
Posting Whiz

Re: Text collect from MSflexgrid to textbox

 
0
  #3
Oct 28th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 471
Reputation: abu taher is an unknown quantity at this point 
Solved Threads: 24
abu taher's Avatar
abu taher abu taher is offline Offline
Posting Pro in Training

Re: Text collect from MSflexgrid to textbox

 
0
  #4
Oct 28th, 2008
its not work.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 471
Reputation: abu taher is an unknown quantity at this point 
Solved Threads: 24
abu taher's Avatar
abu taher abu taher is offline Offline
Posting Pro in Training

Re: Text collect from MSflexgrid to textbox

 
0
  #5
Oct 28th, 2008
sorry it works
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 304
Reputation: aktharshaik is an unknown quantity at this point 
Solved Threads: 37
aktharshaik's Avatar
aktharshaik aktharshaik is offline Offline
Posting Whiz

Re: Text collect from MSflexgrid to textbox

 
0
  #6
Oct 28th, 2008
Can u attach the three forms?
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 471
Reputation: abu taher is an unknown quantity at this point 
Solved Threads: 24
abu taher's Avatar
abu taher abu taher is offline Offline
Posting Pro in Training

Re: Text collect from MSflexgrid to textbox

 
0
  #7
Oct 28th, 2008
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 ........
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 304
Reputation: aktharshaik is an unknown quantity at this point 
Solved Threads: 37
aktharshaik's Avatar
aktharshaik aktharshaik is offline Offline
Posting Whiz

Re: Text collect from MSflexgrid to textbox

 
0
  #8
Oct 28th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 471
Reputation: abu taher is an unknown quantity at this point 
Solved Threads: 24
abu taher's Avatar
abu taher abu taher is offline Offline
Posting Pro in Training

Re: Text collect from MSflexgrid to textbox

 
0
  #9
Oct 28th, 2008
label1 mean?
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 304
Reputation: aktharshaik is an unknown quantity at this point 
Solved Threads: 37
aktharshaik's Avatar
aktharshaik aktharshaik is offline Offline
Posting Whiz

Re: Text collect from MSflexgrid to textbox

 
0
  #10
Oct 29th, 2008
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.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC