C
calling user control method from another
Hi all, I have developed an addin for outlook using C# (VS 2005). My Add-in
adds sum buttons to outlook as well as a panel at the side of outlook. The
panel displays sum discussions of our forum and also displays the profile of
selected user.
Here the panel is a user control which contains sum general controles lky
labels n text boxes.... n have sum methods which extracts the required values
n fills in the labels n textboxes.
i m using 1 more form for login. nw the problm is when the user opens the
outlook the login form will b displayed, n when the user enters a valid id n
password it should call refresh button (in MyPanel - UserControl) which fills
the required info n make it visible...
So here i need to access the method in MyPanel from a Login form.
As i dont hav much experience in C# i m not getting hw to do this. I tried
making the "Refresh" link as static but this Refersh link calls a non-static
method "ST_FetchMsgs()".
If i make this method as static then i need to make all the controles in the
panel as static.
When the login form is displayed i already hav Refresh link in the panel. so
after successful login i just need to click this Reresh link. This can be
done if i can get the reference to the existing "MyPanel".
To refer to the existing form v do the following:
frmNewMsg objfrmNewMessaage = (frmNewMsg) ActiveForm;
Then we can access the public controles/methods of that form. Similarly is
der any way to get the reference of the existing user control? (as it is
already loaded in outlook)
Thanks in advance,
Mahesh S
adds sum buttons to outlook as well as a panel at the side of outlook. The
panel displays sum discussions of our forum and also displays the profile of
selected user.
Here the panel is a user control which contains sum general controles lky
labels n text boxes.... n have sum methods which extracts the required values
n fills in the labels n textboxes.
i m using 1 more form for login. nw the problm is when the user opens the
outlook the login form will b displayed, n when the user enters a valid id n
password it should call refresh button (in MyPanel - UserControl) which fills
the required info n make it visible...
So here i need to access the method in MyPanel from a Login form.
As i dont hav much experience in C# i m not getting hw to do this. I tried
making the "Refresh" link as static but this Refersh link calls a non-static
method "ST_FetchMsgs()".
If i make this method as static then i need to make all the controles in the
panel as static.
When the login form is displayed i already hav Refresh link in the panel. so
after successful login i just need to click this Reresh link. This can be
done if i can get the reference to the existing "MyPanel".
To refer to the existing form v do the following:
frmNewMsg objfrmNewMessaage = (frmNewMsg) ActiveForm;
Then we can access the public controles/methods of that form. Similarly is
der any way to get the reference of the existing user control? (as it is
already loaded in outlook)
Thanks in advance,
Mahesh S