473,804 Members | 3,638 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cross form communication.. .

Using VS2005, VB.NET, I have am developing a windows app that has a
login form. This login form can be called by several classes. When the
login form is able to verify that the supplied credentials are valid
then I want to pass an object (System.Net.Cre dential) back to the
calling/parent class. All the classes that call the login form have a
public property named "_oCredenti als" that could be used to store
validated credentials.

My problem is knowing what class opened/called the login form and
getting the code in the form to store the validated credentials back
in the correct parent...

Hope this makes sense. Your input appreciated.

FYI, here is how I am calling the form now (from any of the "parent"
classes)
'Gather domain credentials
Dim frmLogin As New frmDomainLogin
frmLogin.ShowDi alog(Me)

Oct 10 '07 #1
4 1959
On Oct 10, 9:56 am, hzgt9b <celof...@gmail .comwrote:
Using VS2005, VB.NET, I have am developing a windows app that has a
login form. This login form can be called by several classes. When the
login form is able to verify that the supplied credentials are valid
then I want to pass an object (System.Net.Cre dential) back to the
calling/parent class. All the classes that call the login form have a
public property named "_oCredenti als" that could be used to store
validated credentials.

My problem is knowing what class opened/called the login form and
getting the code in the form to store the validated credentials back
in the correct parent...

Hope this makes sense. Your input appreciated.

FYI, here is how I am calling the form now (from any of the "parent"
classes)
'Gather domain credentials
Dim frmLogin As New frmDomainLogin
frmLogin.ShowDi alog(Me)
You could create a interface for all your parent forms to implement.
Call it something like iCallTheLoginFo rm or whatever is appropriate.
Then in your login form you can reference the parent form by casting
it to your interface.

Public Interface iCallTheLoginFo rm
Public Property LoginCredential as System.Net.Cred ential
End Interface

Public Class MainForm
implements iCallTheLoginFo rm

Public Property MainForm_LoginC redential As System.Net.Cred ential
Implements iCallTheLoginFo rm.LoginCredent ial

.....

Public Class LoginForm

Private myParent as iCallTheLoginFo rm

Public Sub New(p as iCallTheLoginFo rm)
myParent = p
End Sub

.....
That should be a good start, I quick typed that one, so it might have
a typo...

Oct 10 '07 #2
You could create a interface for all your parent forms to implement.
Call it something like iCallTheLoginFo rm or whatever is appropriate.
Then in your login form you can reference the parent form by casting
it to your interface.

Public Interface iCallTheLoginFo rm
Public Property LoginCredential as System.Net.Cred ential
End Interface
Thanks for the quick response... unfortunately I am unable to declare
a property of type "System.Net.Cre dential" as the return type in the
interface (even after importing System.Net)...

Oct 10 '07 #3
what i usually do in this situation, is overload the ShowDialog function wiht
my own return type, then do the base form's showdialog then return the
info....ex

Public Overloads Function ShowDialog() As String

MyBase.ShowDial og()

Return String.Empty

End Function

and there ya go. hope this helps
--
-iwdu15
Oct 10 '07 #4
Thanks, I implemented an interface and then did the case back to the
form... works great.

Oct 12 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4126
by: MatthewRoberts | last post by:
Howdy All, I am having difficulty with two-way communication across AppDomains in an attempt to dynamically script applications. Everything works as expected, except when using ByRef parameters. The below explanation is lengthy, but well worth the read. If you can help me, I'd gladly share this code which has greatly helped my development of extensible applications.
7
2433
by: Urs Vogel | last post by:
Hi For my application server, I had to overcome some limitations in older COM-database drivers, whers sessions per driver instance are limited. Instantiating the COM component several times does not help, since it still reports the same Process ID to the DB server, so the limit persists. When launching several external components (EXEs), each loading its own database driver, the limitation problem is solved. I built this using .Net...
1
1437
by: Modica82 | last post by:
Hi all, I have been trying to find a way to send a PDF from my web service. I have had the idea of sending back a byte array, but to be honest the efficiency issue is there and i would like to find another route if possible. I have started to read bits and pieces about DIME and WSE but what i need to know is can i utilise this technology cross platform?? For instance someone who will consume this web service is coding in some form of...
4
2170
by: Jacob JKW | last post by:
Having read the CLJ FAQ and having done extensive Googling, I do understand that in in general cross-domain iframe scripting is not permitted. One issue I have not seen directly addressed, however, is scripting across different but still "friendly" domains. Essentially I'd like to send a signal from the child to the parent in any form at all. I would think that there might exist a way to set some variable or object property that could...
1
2063
by: NagarajanS | last post by:
hi, i have a problem in cross thread communication.my problem is i drog some controls in the form.now i created new thread inside the coding of form.cs.when i try to run that thread it shows the "cross thread communication".is any possible to send the user control objects to the new thread?or what i have to eliminate this error. regards nags
0
280
by: zb | last post by:
Here is the page architecture: Page loads multiple user controls (including nested user controls) dynamically based on parameters provided into place holders. Note: The page only has the logic to load the user controls and subscribe to custom event exposed in the user controls. Scenario: User comes to this page fills the fields generated by multiple user controls and then hits "Save" button in one of the forms.
13
3392
by: Jeff | last post by:
We have an intranet website that currently uses ActiveX but we need to make it cross-browser compatible and also get around the problems we've been having with making it work with IE7 and Vista. We decided to write an external application to do the work from the client side. We are not sure how the web page can call the app though with parameters. For example, we want to do similar to what the MSDN Library and Audible are doing with...
1
2004
by: pankaj17 | last post by:
hello , Cross-Domain Communication Between IFrames in this script they have included 2 iframes. parent can send a message to both iframes and frames can send massage to each other. they have called the function at particular event . I don't want to call the function at particular event.(they have sent the message at button (sentbtn) click event) . in My example i have 2 or more text box these are generated dynamically . and when...
3
5355
by: hash4sp | last post by:
Hello Can anyone here please guide me with the Cross Domain Communication between IFrames. Problem: Application1 running on IIS => http://localhost.ad.local/Applicaiton1 Application2 running on Apache => http://localhost.ad.local:8080/Application2 The Application2 is being loaded in an IFrame inside Application1; and there needed a communication beetween the two Applications. With IE my application works but with FireFox it doesnt.
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9144
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3816
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.