dejandejanovic
asked on
How to get data from aplication open forms (WindowsApplication.exe) ?
Hello,
I'm trying to solve how to get data from open application windows. For example, if user is login into as John, and another one as Paul. Of course both has open same application, but with different names, and with same control lblMembers from behind script.
I would like somehow that Server form get both names on Listbox, or similar.
I have try with code from Server Form, but of course not working.
Thank you in advance for help to anyone.
Codes:
Login form:
Client form:
Server form:
I'm trying to solve how to get data from open application windows. For example, if user is login into as John, and another one as Paul. Of course both has open same application, but with different names, and with same control lblMembers from behind script.
I would like somehow that Server form get both names on Listbox, or similar.
I have try with code from Server Form, but of course not working.
Thank you in advance for help to anyone.
Codes:
Login form:
Public Class Login
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If txtUsername.Text = "john" Or txtUsername.Text = "paul" Then
MsgBox("Welecome " & txtUsername.Text.ToUpper)
Clients.Show()
Me.Hide()
ElseIf txtUsername.Text = "admin" Then
MsgBox("Welecome " & txtUsername.Text.ToUpper)
Server.Show()
Me.Hide()
Else
MsgBox("Invalid username. Please, try again")
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Application.Exit()
End Sub
End Class
Client form:
Public Class Clients
Private Sub Clients_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lblMember.Text = WindowsApplication1.Login.txtUsername.Text.ToUpper
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Application.Exit()
End Sub
End Class
Server form:
Public Class Server
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ListMembers.Text = WindowsApplication1.Clients.lblMember.Text
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Application.Exit()
End Sub
End Class
PrintScreen.JPG
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ok...but the techniques used to get the values from Forms in the same application are completely different from those used to get values from Forms running in a different instances.
Furthermore, retrieving values from instances running on a different machine would also be different.
Thus the questions about how the end system is going to be used. Going down the route you've started is probably pointless as it can't be translated to communication across a network or the internet.
Furthermore, retrieving values from instances running on a different machine would also be different.
Thus the questions about how the end system is going to be used. Going down the route you've started is probably pointless as it can't be translated to communication across a network or the internet.
ASKER
Can you please give me some tips which method to use, where to start, or something?
Thanks
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Are you going to communicate only with machines behind a firewall?...or across the internet?
Again, what your end product is supposed to do ditactes what technologies can be used and how they must be employed.
Again, what your end product is supposed to do ditactes what technologies can be used and how they must be employed.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
topic close
ASKER
I have replace ListBox with Label control just to see what I will get, and I have got a default label text Label1, and not a result such as login name ?!
PrintScreen.JPG