YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Non=Modal UserForm Closes After Running a Subroutine That Creates a Bar or Value Options · View
jhcoxx
#1 Posted : Saturday, May 07, 2011 4:55:33 AM
Rank: Member
Groups: Member

Joined: 7/5/2010
Posts: 27
Location: Texas
I've encountered something odd and need a workaround.

We're trying to help end users set up their own ProcessBooks with some standard components, so I created a userform that has MS Forms textbox input fields whose values are used to set the attributes of some Symbols. The userform also has a Forms command button whose _Click event executes the ThisDisplay.Symbols.Add(appropriate symbol type constant) method. The user form needs to be non-modal so the users can interact with the Display before and after creating the Symbol.

This works fine if the Symbol being created is a circle (Ellipse) or a Rectangle. However, when a Bar or a Value is being created, the strange behavior occurs. When the userform's command button _Click event runs and adds the Bar or Value, the userform closes immediately after the _Click event code finishes executing. Tracing through the code, it's the execution of the .Add statement that triggers whatever is causing the problem, but the userform doesn't close until the _Click event sub finishes executing.

I've tried playing with other userform events, but haven't found anything that can keep this from happening. It's a pain, because the user needs to be able to copy some information that's being displayed on the userform after the Symbol is created, but the form closes before they have a chance. Also, they would have to re-enter a lot of the same information to set up the creation of the next Symbol, because what they had entered goes away when the form closes.

If the userform is set to .Showmodal = True, then even for Bars and Values, the userform stays open after the _Click event code complets, but that means the users can't interact with the Display because the userform is Modal.

Anyone seen this behavior, know what's causing it, or much better, know a way to keep it from happening?

Thanks for any insights!

James
Sponsor  
 

OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System.
We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ  or contact OSIsoft vCampus for more details.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.