|
-
Feb 27th, 2006, 09:39 AM
#11
Thread Starter
Lively Member
Re: exchange text values in an text box array
Yes, that's what I have: 10 texts on Form1, and 2 combos on Form2. The first code that I got from David did work in it's own application, but not in mine. I have the button to open Form2 (combo boxes) on another form (I only hide this third form). When the exchange is done, it goes back to the third form. There are also list indexes that I exchange on that form (It works). The second form might hide, if the user selects close when they close it, it hides. The user might select the "x" instead, though, which unloads the form. Your way works in a seperate program, too, but not in mine. I am not ready to post my project, but maybe my little extra explanations here about what you seem to not understand will help.
But here's some more code. Here's in my Public Sub Exchange() Sub. This is to exchange the list indexes on the third form that I was talking about:
VB Code:
'If Details are being moved, then call
If chkMoveDetails.Value = True Then
Call MoveDetails
ElseIf chkMoveDetails.Value = False Then
'Take no effect
End If
I only want the textboxes (details) exchanging if the user has checked a checkbox checked (It's called chkMoveDetails).
VB Code:
Public Sub MoveDetails()
Dim DetailsExchangeSpace As String
frmDetails.Show
frmDetails.txtDetails(0).Visible = True
frmDetails.txtDetails(1).Visible = True
frmDetails.txtDetails(2).Visible = True
frmDetails.txtDetails(3).Visible = True
frmDetails.txtDetails(4).Visible = True
frmDetails.txtDetails(5).Visible = True
frmDetails.txtDetails(6).Visible = True
frmDetails.txtDetails(7).Visible = True
frmDetails.txtDetails(8).Visible = True
frmDetails.txtDetails(9).Visible = True
frmDetails.Hide
DetailsExchange = frmDetails.txtDetails(cboExchange.ListIndex)
frmDetails.txtDetails(cboExchange.ListIndex) = txtDetails(cboExchange.ListIndex)
frmDetails.txtDetails(cboWith.ListIndex) = DetailsExchange
End Sub
frmDetails is the form with my textbox array on it. txtDetails is the textbox array.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|