Please explain ChangeUICues - vb.net

The following "explaination" from the Microsoft MSDN is sematically void to me:
Occurs when the focus or keyboard user interface (UI) cues change.
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.changeuicues.aspx
Can anyone provide a substantive definition... or a resource that describes this event?
Even the following references from the MSDN don't help:
http://msdn.microsoft.com/en-us/library/system.windows.forms.uicues.aspx
OR
http://msdn.microsoft.com/en-us/library/system.windows.forms.uicueseventargs.aspx
All of these assume that the reader knows what a UI Cue is...

This event is fired when the UICues change for a control.
What is a UI Cue? Take a look at the UICuse enumeration documentation:
This enumeration is used to specify which user interface cues will be displayed or changed. For example, when the user presses the ALT key, the keyboard shortcuts on the menu are displayed by underlining the appropriate character. The bitwise combination of UICues for this example would be ShowKeyboard and ChangeKeyboard.
In other words, a UI Cue is a visual indicator for the user of the software's internal state which might not otherwise be apparent. For example (different from above), when a button has "focus" (meaning pressing the Enter or Return key will initiate the associated Click event), the OS provides a "UI Cue", usually a dotted rectangle around the edges of the button, indicating that that particular button (and not one of the others on the screen) has keyboard focus.
Without these UI Cues, the user may not have way of determining the internal state of the software, rendering the behavior unpredictable (as in, when I press Enter I won't know which button will be "clicked").
According to the documentation (follow the link above), a WinForms control supports the following cues (which can be combined using bitwise logic):
ShowFocus Focus rectangles are displayed after the change.
ShowKeyboard Keyboard cues are underlined after the change.
Shown Focus rectangles are displayed and keyboard cues are underlined after the change.
ChangeFocus The state of the focus cues has changed.
ChangeKeyboard The state of the keyboard cues has changed.
Changed The state of the focus cues and keyboard cues has changed.
None No change was made.

Related

Labview button freezes after pressed once

I'm trying to program something to read voltage from the Labview ULx library and add the voltage into an array. I tried to do so using an event structure while setting a boolean button 's mechanical action to "Latch when pressed". However, the "Latch when pressed" option seems doesn't work and the program reads the voltage and adds it to the array correctly and it freezes.
front panel
Block diagram:
When you use a Value Changed event with a latched Boolean control, you need to read the control's value inside the event structure in order to reset the latch.
Just move the Sample control's terminal inside the event structure, then it should work as you expect.
Tip: you are free to use the Latch When Pressed action if you want, but the standard action for UI buttons in the OS (Windows etc) is actually Latch When Released. You can check this by clicking on a button, dragging the mouse pointer off the button and then releasing it - the button shouldn't operate. You might want to decide which one makes more sense for your application.

Move focus to other UIButton

I am working on a small game for Apple TV, and one thing I can't get to work is moving the focus from one button to the other (programmatically), or temporarily remove focus from any object (buttons) as the game is doing stuff.
I've seen the guide about objects and focus, but is there really no way to programmatically move the focus to an other part of the screen as the input is needed there (instead of letting the user move all the way across the screen)?
There will always be a view that has focus. It's not possible to not have a focused view.
You could temporarily change the focused appearance of an item, so it doesn't appear to have focus, but that would likely be be confusing for the user, or conflict with Human Interface Guidelines.
There's no explicit way to programmatically move focus from one control to another, per the App Programming Guide for tvOS:
The Focus Engine Controls Focus
Only the focus engine can explicitly update focus, meaning there is no API for directly setting the focused view or moving focus in a certain direction. ...
The focus engine controls focus to make sure that it does not move around the screen unexpectedly, and that it behaves similarly across different applications.
Answers to other questions have suggested that you could "game" the system by overriding preferredFocusedView, conditionally setting it to the desired control to move to, then requesting a focus update. Such an approach would likely be fragile.

Infragistics State Button Checked doesn't show borders

Here is my question. I have some state button tools in my Toolbars Manager. When I set Checked = True, I don't see that button is checked. Actually I see it, but without borders as usual. Instead of that I can see light-light blue background in my state button tool. Could you please answer why is it happen and how can I change my code to view state button checked state as usual (with borders and usual background) ?
I was able to reproduce your problem setting the BorderAlpha property to Transparent.
Resetting to Default reenables the border around the Tool.
The property is present in every Appearance settings of the button, but the one I have used is the PressedAppearance of the Tool (Large or Small depending on your customization)

Controlling NSSegmentedControl with the keyboard

I have a form in my Cocoa app that contains an NSSegmentedControl that I want to be controllable via the keyboard. It seems that NSSegmentedControl is very reluctant to become the first responder, however.
Setting the initial first responder of the window to the segmented control does nothing -- it will not have keyboard focus when the window is first loaded. It does receive focus if I manually set the first responder like this, however:
[segmentedControl.window makeFirstResponder: segmentedControl];
That will work fine if the only part of the form is the segmented control. If I add another field (say, an NSTextField), and I set the nextResponder of the segmented control to that field, the segmented control will never become first responder. Focus will immediately go to the text field, and pressing tab to switch back to the segmented control doesn't work.
I've tried subclassing NSSegmentedControl and overriding acceptsFirstResponder, becomeFirstResponder, etc. to no avail. The only one that makes any difference is resignFirstResponder -- if I return NO from that method then the segmented control will indeed retain focus, but obviously I don't want it to retain focus all the time.
Any ideas on how to get the control to behave like a normal responder?
It's behaving as intended. Not all controls participate in the "key view loop". Full keyboard navigation is turned on through Universal Access in System Preferences for all apps and it's not for individual apps to implement on their own.
It's best not to use a segmented control in a form intended for heavy keyboard entry. NSPopUpButton works more closely to what we all exepect in a web form so it's not as if it's necessarily the wrong choice in your app's UI.
Rather than answer exactly the question you asked (which someone else can do), I humbly suggest you choose on the side of functionality at the cost of a slightly prettier UI element since that prettier UI element wasn't intended to get along with the keyboard.

VB.NET Minesweeper issue

I have fully programmed my Minesweeper; however, I was having difficulty trying to get the same result as in the original minesweeper for when a user clicks and moves the mouse around while still right clicking. You may notice that in the original Minesweeper, when a user does as explained, the tiles that the user goes to will then look blank. If the user releases the mouse, the current tile they hovered to will become the clicked tile. In my Minesweeper, the tile I click on is the only one that will look blank, and when I hover over to the next tiles, they do not get blank like the first one I clicked on. Then when I release my mouse button when over to another tile, the very first tile I clicked on is the one that gets uncovered. Here is what I already have used. I have the MouseDown event which checks to see if the game has been started to begin the game timer. It also has some color properties for tiles when I click on them and I set a boolean to true or false depending on the user left or right click. I have the MouseUp event which looks at the boolean to determin what the user had clicked on the mouse so I know if I flag or simply click to uncover. Then I have the MouseEnter and MouseLeave which are needed to yield the proper glow I want for the tiles. What should I do to get the same results as in the original Minesweeper with the MouseDown and MouseEnter into other tiles? I tried many other things such as MouseEnter, MouseMove and MouseHover, but all seem to yield the same crummy result as what I already have.
Just another piece of information, the MouseEvents are built in to a UserControl which I then use as my tile in Minesweeper. It almost as if when an event is active, another one cannot be done at the same time.
You might want to consider, DragOver and Drag related events