Link to home
Start Free TrialLog in
Avatar of sirbounty
sirbountyFlag for United States of America

asked on

Have two projects 'talk'

I've written one app that scans a remote share and creates an excel spreadsheet of the findings.
In my other app, I'd like to 'paste' the other app's form class and pass the value of my primary form's txtShare to txtShare of the 'imported' form.  I'm not quite sure if it's as simple as 'loading' it (which I've yet to learn how to do in .net) and then assigning the value of that form's text box to the primary's?
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sirbounty

ASKER

I just added existing into my project.  Is that the 'wrong' way to do it?

I was trying this in my main form's 'leave' routine:

       frmScan.txtShare.Text = Me.txtShare.Text
But I'd then need to generate a keydown...how?
Or I guess I could hide a button and make it my form's "accept"...?
1) .NET version?

2) What type of project is #1

3) What type of project is #2

4) Are you looking to have project #1 do all the scanning for project #2?

Bob
Sounds like he just needs a shared string in a modual
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mydasx
mydasx

note:  file locking will be needed for either the xml or flat file approach.
Sorry - cable has been out...

1) .NET version?  = 2005

2) What type of project is #1  
3) What type of project is #2

I'm not sure these really matter now?  I've combined the two - and it's 'working'

4) Are you looking to have project #1 do all the scanning for project #2?

How to answer this... Um - I just used the 'leave' routine for the related text box to kick off the 'accept' routine of the other form (I went ahead and made the hidden button).  

But...is there a 'better' way?
I don't really understand what you have described, so it is difficult to suggest a "better" way.  A better way of doing what?  You probably can't see where I am not getting it, huh?  ;)

Bob
Sorry 'bout that - let me detail what I'm doing now.

On (we'll call it Form1), I have txtShare.

On Form2 - I have another txtShare.  Now this form was actually just 'imported' into this project.  By itself, it has the text box that when a share name is entered, it scans that share for different file types and creates an output report in Excel.

So, after importing it, I needed Form1 to call that same function from Form2.
So, I just created the following to do just that (though I'll probably make this into a button or check box to initiate it, since it should be up to the user if they want to scan now or not)...

    Private Sub txtShare_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtShare.Leave
        frmScan.txtShare.Text = Me.txtShare.Text
        frmScan.AcceptButton.PerformClick()
    End Sub

But as far as the method I'm using (the 'AcceptButton.PerformClick') - that an okay 'solution' for me here, or am I forcing a square peg into a round hole?
If it is OK with you, I can't see a better way.  

If you get a big hammer, you can always get a square peg in a round hole, BTW *LOL.

Bob

;^)
Cool...just wanted another opinion.
Thanx Bob.