Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Experts*
Posted

Do you really want to Activate the other form, or just run the code in that event?

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
  • *Experts*
Posted

Well, you could mark the function as public so that another form could see the function. Remember that events are really just functions that are hooked up to get called automatically by windows. But you can still change the "private" word to "public".

 

If it were me, I'd put the code that's currently in your activate event into a separate function. I'd then have the activate event call this function. This function could be marked as public and this function is the one I'd call from the other form.

 

It strikes me as odd that the code you want to run when the form is activated needs to be run from another form...

 

Regardless of how you declare the function, you're going to also need a reference to the form. I'm not sure of how things are setup, but that might be an issue if you're trying to use the class name as the reference (as you could do in VB6). If that's the case, just ask and we can answer.

 

-nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

In fact it's odd... I was just trying to try to find a way to run the code written in the Activate Event of another form without calling a global subroutine, leaving the Activate code as it was. There was a bug I wasn't able to find it and that was just a way to discover it.

 

Now I've found it and solved it.

 

Thank you for replying to such an odd question!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...