In my application, I have to verify if a particular button is enabled or not. It gets enabled after I fill in certain values.
But, the problem is the properties for the button is EXACTLY the same when its enabled and disabled. (Even the value of isEnabled is false in both cases)
If I try to click on that button, it gets clicked in both cases (even it gets clicked when its disabled but however since its disabled nothing happens)
So, how do I proceed now?
Are you sure all the properties are exactly same? Do you have access to the color property? Font color or background color. If yes, then I am sure color for enabled and disabled button would be different. If this is the case- viola!
You can check the height and width of the object to identify the object .
Mostly in masked scenario it will be zero .
Well, if the button is disabled, then clicking it will yield no result. If this is for a web-based application, then you can include a checkpoint in your code to check that no request/response is sent from the webpage. (ie. no communication is initiated from the browser).
Related
I have a Windows Form application with a checkbox that presents different behaviour according to the user. The component appears in the form only for the user who installed first the application.
For other users that have the same privileges, in the same machine, the checkbox is not visible. I already tried to uninstall and reinstall the application with different users, but the problem persists.
In my code, thereĀ“s nothing that changes the Visible property to true or false, I just let the default value to true
Appreciate any help, thanks!
Try resize the window that contains the checkbox. You are probably setting the size or the location of the checkbox in a wrong way. Try to use proper anchor property and see if the problem resolves.
i have a problem in the application that i'm currently trying to make. In checkboxs' properties it says it's Enabled = True but after i debug and open it they all are disabled. Why did this happen? Any helps?
I think the problem here may be one of terminology. You're accessing the 'Enabled' property, but I think you may want the 'Checked' property.
The Enabled property is set by you, and controls whether the user can click on the checkbox or not. The Checked property is set either by you or by the user, and it changes whenever the user clicks on the checkbox.
Here's a picture of four checkboxes:
Check Box One is Enabled, and not Checked.
Check Box Two is Enabled, and Checked.
Check Box Three is not Enabled, and not Checked.
Check Box Four is not Enabled, and Checked.
I have a typical case of implementing a preference panel for my application, but I've run into a problem with detecting changes to any preference values. In my case I don't want to apply changes automatically so I've set
[[NSUserDefaultsController sharedUserDefaultsController] setAppliesImmediately:NO];
I've also bound all my controls in my preference panel to sharedUserDefaultsController.
And then I have a Cancel and a Apply button in my preference panel, and I want to only enable the Apply button if any changes had been made to the sharedUserDefaultsController values.
So I thought I could bind hasUnappliedChanges of my sharedUserDefaultsController to my Apply buttons enable property. But hasUnappliedChanges only return true, even if no changes have been made. Or actually it returns false as long as I do not load my preference panel window. But as soon as the window is loaded and it reaches awakeFromNib, hasUnappliedChanges returns true. And from there on I can't get it to reset back to false. Doesn't matter if I save the sharedUserDefaultsController.
So my questions are:
How do you properly detect if any values of sharedUserDefaultsController has changed?
And does hasUnappliedChanges work when you bind your controls to sharedUserDefaultsController?
Appreciate any help I can get.
Edit
I tried observing NSUserDefaultsDidChangeNotification, but that only post an update after a value is saved to the user defaults. In other words, after I call
[(NSUserDefaultsController*)[NSUserDefaultsController sharedUserDefaultsController] save:sender];
So unless I'm using this wrong way that wont work as far as I can tell.
For cytoscape.js 2.0.[0-1], on touch-devices, by default, as you click on nodes/edges, every one of them gets "selected" -- causing multiple-selections as user taps on different elements within the network. Is there an option to prevent this behavior so that every tap selects the target element and unselects the rest?
I don't think so, but we will add one:
https://github.com/cytoscape/cytoscape.js/issues/290
I have a windows application with a tabcontrol. One of the tab of the tabcontrol has a webbrowser control.Now the issue that I am facing is when the focus is inside the webbrowser control, the normal Ctrl+Tab functionality of the tabcontrol is not working.I want the Ctrl+Tab to change the selected tab of tabcontrol even when the focus is inside webbrowser control in selected tab.How to achieve this ?
I have already tries overriding ProcessCmdKey.but it does not get hit when focus is inside webbrowser control.
I also tried registerhotkey method ,it works but it locks the Ctrl+Tab hotkey within my application & system doesn't respond to any other Ctrl+Tab presses outside my application when application is running, which is expected behaviour of registerhotkey.
Here is the code you need:
If WB.ContainsFocus Then
MsgBox("We have focus, disappearing...")
WB.Document.Body.RemoveFocus()
End If
Now, the question is, when to run that code. If you put it in the WebBrowser1_GotFocus event, you'll need to turn it on and off. Turn the code off if the user is interacting with the WB Control, and turn it back on when they are not and when you expect to be experiencing the problem you've mentioned.
Of course, you could add another line to ensure a particular control/tab/panel etc gets focus after you remove focus from the body. Also, here are 3 other SO questions that have answers which may help you, but these will take you in directions different to the direction I've provided, probably due to the fact that the questions are not identical to yours, but are similar enough to be useful (not listed in order of preference).
Prevent WebBrowser control from stealing focus?
Webbrowser steals focus
Focusing WebBrowser control in a C# application
UPDATE:
I just wanted to add, instead of the .Body.RemoveFocus() you could do this:
WB.Document.Body.Parent.RemoveFocus()
Which I prefer, since the .Document object didn't have an explicit .RemoveFocus method on the intellisense I was gettign in VS2012 RC. This is probably referring to the HTML tag (and not the .Document object) and since the html tag is the only parent to the body tag, it makes sense, and there is no "HTML" object directly available in the intellisense under object, since you can get it via other means, so it's just more convenient doing it this way.
Cheers, and let me know if you need more info on anything.