buttonclick

WPF Application stalls/freezes after first interaction, like button click

老子叫甜甜 提交于 2019-12-06 20:59:44
问题 I'm currently experiencing a problem in WPF. The UI loads fine, but whenever the first user interaction is made, such as a button click, the application seems to stall, or example if I had two buttons that display a MessageBox, the first click will wait for a few seconds then show the MessageBox, but any subsequent interaction is instantaneous and responsive. Has anyone else experienced this? And if so, is there any solution? Thanks 回答1: I had the same problem. Every time I called the first

get OnClick() from programmatically added buttons?

牧云@^-^@ 提交于 2019-12-06 15:01:53
i have added some button in a layout: LinearLayout row = (LinearLayout)findViewById(R.id.KeysList); keys=db.getKeys(console); my_button=new Button[keys.size()]; for (bt=0;bt<keys.size();bt++){ my_button[bt]=new Button(this); my_button[bt].setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.FILL_PARENT)); my_button[bt].setText(keys.get(bt)); my_button[bt].setId(bt); row.addView(my_button[bt]); my_button[bt].setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (my_button[bt].getId() == ((Button) v).getId()){ Toast.makeText(getBaseContext(

How can I keep executing work while a button is pressed?

删除回忆录丶 提交于 2019-12-05 14:39:22
I want to keep executing work while a button is pressed, using Java. When the button is released, the work should stop. Something like this: Button_is_pressed() { for(int i=0;i<100;i++) { count=i; print "count" } } How might I achieve this? One way: Add a ChangeListener to the JButton's ButtonModel In this listener check the model's isPressed() method and turn on or off a Swing Timer depending on its state. If you want a background process, then you can execute or cancel a SwingWorker in the same way. An example of the former: import java.awt.event.*; import javax.swing.*; import javax.swing

javascript linking onclick to a .js to a file

半腔热情 提交于 2019-12-05 09:36:34
I created a .js file, and then included it in the HTML pages by: <script type="text/javascript" src="yourexternalfile.js"></script> How do I call the function of the .js file using onclick = "...." ? I know that it will be something like: <input type="BUTTON" value="Exit" onclick="javascript: ???;" > but I can't figure it out... If you are using JQuery, you can do it like this, <input type="button" onclick="javascript: $.getScript('../scripts/yourfilepath' , function (){ youFunctionCall() ; } );" /> This will download the JS file when the button is cliked and shall execute the function called

Click events on overlapping items

点点圈 提交于 2019-12-05 02:36:52
I have table row with click event button with click event, that button is on table row and I have problem. When I hit button, row click event execute too, but I don't want this behavior. I want only button click execute, without row click. look at your code this is what you should do in the button click event stopPropagation Using jQuery (due to question tag): $('#yourButton').click(function(e) { // stop event from bubbling up to row element e.stopPropagation(); // now do your stuff }); user160820 You can call an extra function onClick this is the function: function cancelBubble(e){ e

WPF Application stalls/freezes after first interaction, like button click

强颜欢笑 提交于 2019-12-05 02:07:04
I'm currently experiencing a problem in WPF. The UI loads fine, but whenever the first user interaction is made, such as a button click, the application seems to stall, or example if I had two buttons that display a MessageBox, the first click will wait for a few seconds then show the MessageBox, but any subsequent interaction is instantaneous and responsive. Has anyone else experienced this? And if so, is there any solution? Thanks I had the same problem. Every time I called the first interaction from a Button or ICommand the UI would freeze for like half a second. I tracked down the issue

How to open number dialer pad programmatically in android?

岁酱吖の 提交于 2019-12-04 16:17:37
问题 I want to display Number Dial Keypad (Phone Call) Programmatically on button click in android. Code is available for direct number dialing but I only need to show the dial keypad when I click the Button. 回答1: Intent intent = new Intent(Intent.ACTION_DIAL); startActivity(intent); 回答2: Intent intent = new Intent(Intent.ACTION_DIAL); intent.setData(Uri.parse("tel:9999999999")); startActivity(intent); For this we don't need to add any permission in AndroidManifest.xml 回答3: Intent intent = new

Using ADB to access a particular UI control on the screen

百般思念 提交于 2019-12-04 10:40:29
问题 Is it possible for adb shell console to access an Android app's specific button using its id? or text? I'm trying to automate the button click on the device. This is a web app accessed from a browser. So if I have that button id can I send an action to that button? 回答1: I think the best you can do is to inject touch based on a coordinate. Please see send touch event from ADB to a device and simulating touch using ADB You might get a coordinate of a button from dumpsys window or activity. You

Swift, Custom UIButton does not work when click

最后都变了- 提交于 2019-12-04 06:46:37
I have a custom UIButton created with xib file. When i use my custom button on my view, it does not work when i press to it. My RoundBtn.swift file: import UIKit @IBDesignable class RoundBtn: UIButton { var nibName = "RoundBtn" @IBOutlet weak var btnImageView: UIImageView! @IBOutlet weak var btnLabel: UILabel! @IBInspectable var image: UIImage? { get { return btnImageView.image } set(image) { btnImageView.image = image } } @IBInspectable var label: String? { get { return btnLabel.text } set(label) { btnLabel.text = label } } override init(frame: CGRect) { super.init(frame: frame) setup() }

Form validation on Button click in android

99封情书 提交于 2019-12-04 06:38:36
问题 I'm Developing an android app in which the Login activity has editText,RadioButton,Spinner and a button.So when the button is pressed I've to validate my form by checking whether all the fields filled else a alert message is given to the user.Can anyone please help me with the java code. Thanks in Advance. public void OnClickListener(View v) { name=(EditText)findViewById(R.id.editText1); years1=(RadioButton)findViewById(R.id.radioButton3); years2=(RadioButton)findViewById(R.id.radioButton4);