Condition in Event Structure Labview - structure

Hi Guys,
I have in my labview project the needs to use the same prev/next buttons with different tab controls, so I tried to put the value change of those buttons in an event structure but I would to put in AND condition the availability of the current tab.
Any Idea??
Thank you very much.
Guido

You have to consider using Dynamic Registering for Events: http://zone.ni.com/reference/en-XX/help/371361K-01/lvhowto/dynamic_register_event/
You should create Dynamic event register and when tab control state is enabled/visible you will generate user event.
For example please refer to NI Example Finder and open "User Event Generation.vi"
Hope this helps!

If you use property nodes for the tab controls, you can use the equality primitive to confirm whether the currently active tab is the one your event should handle. By adding more checks or processing, you can eliminate false positives.
Example
Apologies for the bad wiring, the snippet tool mutated the block diagram.

Related

How Can I Pass An Event Handler Outside Of A Custom Class

I have created a custom Textbox using a new class of which inherits. To this custom Textbox I have added two buttons (embedded) inside the control which are both declared inside the class. One button is for Search and the other for Clear.
The purpose behind these buttons is to populate a Listview control when using Search and Clear the results when using clear...pretty straight forward.
However, my issue that I need help with is...
Because I have declared these buttons inside of my custom class, I cannot work out how to pass a 'Click' event outside of the class and back to the form. For example, if I type into the Textbox and hit the search button, I somehow need to execute code on the click event (and same for clear).
I have read a little about not being able to pass event handlers outside of the class it was created, but I'm not really familiar with this.
Is there/and if so what is the best way to achieve my results? Is it possible to handle a click event outside of the class to pass information to other controls?
Any help appreciated. Thanks
Thanks to the comments from Hans Passant for putting me on the right track, I was able to refer to this site Raising Events and solve my issue.

Parent form and child User Control communication in WinForms

I have my form with a menu bar and space underneath to display my controls. One of the buttons in my menu bar is suppose to be a print button that prints a graph that's currently in a User Control I display in the form. If the graph was on the form in the print button's eventhandler I could just simply call
graph.printing.print(true)
which isn't going to work in my case since the graph is in the control and not the form.
How do I communicate with a User Control from the containing form and access or pass its variables when needed? I also have a status bar on the bottom of the form which would also need to get updated from the User Control, but I'll be able to deal with that if I got help with just this one part. Please bear in mind, I also have another User Control I'm going to add to the form which will also contain a graph which will need the same treatment as the other graph on the first control when the print button is pressed. I plan on swapping these two out so I have one form displaying one control at a time.
I got this idea from this answer: https://stackoverflow.com/a/18191630/2567273 but after further research I can't find anyone asking about the actual communication process between a form and the control it contains.
I think this answer is close to what I'm looking for, but I think it's leading me down the path to using panels instead of User Controls.
After typing this I noticed the closest answer to my question may be this, but that question has the child raising events and the parent responding while I have the parent raising the event and the parent has to get information from the child.
One way to think about this is Roles. Presumably you built this UserControl to handle the management of the data related to the graphs. As such you can think of them in the Role of a Graphs Specialist . Once you do that, printing them is actually just one more thing it should perhaps do.
The form on the other hand, is not special just because it happens to get receive the command from the user to print. Its role in this might simply to be to know which usercontrol to contact and which method to invoke:
Sub PrintGraphMenuClick....
Select Case something ' determinant as to which UC to contact
Case operation.Foo
ucFoo.PrintGraph
Case operation.Bar
ucBar.PrintGraph
Other menu options like Clear, NewGraph, Save and whatever else there is somewhat the same way. The Form's Role here may be to receive the command from the user and pass it along to the right control, invoking the correct right method and passing the correct parameters - that is not a trivial task.
Of course, rather than a MainMenu, the usercontols could alternatively implement a ContextMenu and even receive those commands directly.
Very often offloading an operation to something else results in so many properties, filenames, streams etc having to be moved from here to there that it becomes burdensome. In this case it is not like the MainForm has some special ability regarding printers that the UserControl cannot handle.
There is only one right solution:
1) Add an event to your user control.
2) Raise the event when the particular "thing" happens in the user control.
3) Attach a handler to the event in Form code.
4) Add code to update the bottom bar in the event handler.

Connect two controls in LabVIEW?

I have two boolean elements or swritches.
When I turn on the first one, the second one should switch off and vice versa.
So, I am trying to make elements both indicators and controls.
I read that I have to turn on the Digital Display which is under the visible items submenu but there is no such option.
Could you please help me figure this out?
Thanks in advance.
I am new in LabVIEW, so if this question has already been answered or if it is a stupid question, I am sorry.
If you want one control on the block diagram with two different user indicators, you should use an XControl, I created a simple example here.
UPDATE: Added a demo VI to the example /UPDATE
If you want two control on the block diagram with two different user indicators, you should use user event and local variables to control the two states:
You can only have 'Digital Display' with a gauge or some kind of numeric control

Capital Only Edit Control

Having a bit of a problem doing this and not sure of it can be done. I have an edit control that a user types into, I would like for the input to be all in capital letters. I tried having a custom action on the edit control to get the property, convert to capital letters and set the property again each time a letter is set but it does not work. I guessed it wouldn't but no harm in trying..:)
Has anyone else solved this? I would like to do it without having a button to press if possible. The dialog in question is a twin dialog if that helps at all.
Thanks for your help
It's not possible using the native built-in Windows Installer UI. The underlying MaskedEdit Control is primitive. There are no events to tie into to validate and modify as the characters are entered. You can only ToUpper() the property when the user clicks Back or Next.
The alternative would be to go with an external UI handler which is a lot of learning and work.

Check if Access 2010 Navigation Subform is Open

I am developing a program to track client information that utilizes a navigation form as a main menu that is open at all times. Many of the subforms have list boxes that need to be requeried as data is entered/changed or the users tend to think that they haven't changed the recordset and we end up with duplicate data. I can't figure out how to check if a specific subform of the navigation form is open before I run a refresh... they are all referenced as 'NavigationSubform'. So, for example, if I add a new job placement for a client, I'd like to run a requery of this listbox in the 'onclose' event to make sure they have the newest info. I can do it... Forms!navMain!NavigationSubform.Form.lstEmployment.Requery ... but it bombs if the user has changed panes on the navigation form before closing the form. This happens a lot: for example, a client interrupts while you are entering Job Placement info and you stop and enter a counseling note before going back to it, leaving the main menu sitting in the 'Clinical' directory. Is there a way to check if a specific subform is loaded within the Navigation Subform object? I've attached a screen shot in the event it helps this make sense.
Thanks in advance for any suggestions!!
Employment Screen
It has been a while but I believe you can use the isLoaded method to determine if a subform is loaded
http://msdn.microsoft.com/en-us/library/office/ff194656.aspx
hope this helps,
Brent
You can check the contents of a subform control with the source object property, for example:
forms!mainform.asubformcontrol.sourceobject
You can also get the name of the form from the form object:
forms!mainform.asubformcontrol.form.name