disabled-control

Disabling items in a Navigation Drawer in Android

匆匆过客 提交于 2019-12-08 19:25:31
I'm using the Navigation Drawer Example downloadable here . I'd like to extend this example to disable the selection of one of the planets. For simplicity, lets say I want to permanently disable the selection of Saturn, and change the text of Saturn to dark gray, and have it not highlight when a user selects it. (in reality, I would like to disable navigation programmatically when a user has changed certain values on the screen not yet saved to the device). The closest thing I've gotten to this is to stop the selectItem() method from being called from within the onItemClick click listener, but

How to access all components beneath top JFrame

不羁岁月 提交于 2019-12-06 15:08:02
问题 Partly for learning purposes, I made a JFrame with 4 JPanel s, 2 JLabel s, and a JMenuBar . I put various components (buttons, textboxes, textarea) into the 4 JPanels. I disabled every one of the components throughout. I then wrote two methods to try to enable everything. Worked partially. Here's the code: public void enableEverything(){ Component [] p = this.getContentPane().getComponents(); for(Component pp : p) if(pp instanceof JPanel) enableAll((JPanel) pp); } public void enableAll(JPanel

How can i have a disabled Text that is scrollable?

北战南征 提交于 2019-12-06 12:19:39
My Text is declared as, Text text= new Text(parent, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.WRAP); It should be disabled in some cases. But when I do text.setEnabled(false); the text's scroll bar gets disabled too and i am not able to see the value in the Text completely. My Text Field cannot be READ ONLY. It should be editable in some cases. I am aware of setEditable() method in Text, but I would like to have the same behaviour as when the Text is disabled i.e, background color change, no blinking cursor(caret), unable to do mouse clicks and the text being not selectable etc. I was able

Using jquery tagit plugin, Is there anyway to disable all entry?

为君一笑 提交于 2019-12-05 16:32:04
I have a page and i am using jquery tagit plugin which works great but i am trying to disable it when i click on a button, and have it have similar behavior to when i disable a select Dropdown like this: $("#selectDropdown").val(0); $('#selectDropdown').prop('disabled', 'disabled'); Is there anyway to disable and enable the jquery tagit Plugin programatically. I see there is a readonly option on the docs page so I tried doing something like this: $("#locationTags").tagit({ "readOnly": false }); but that doesn't seem to do anything. Any suggestions? The following demonstrates how you could

Disable Next in Jquery datepicker

半城伤御伤魂 提交于 2019-12-05 02:34:28
问题 Is there any other way by which I cannot allow the user to select next months. I had gone through some threads but I don't want to disable both next and previous buttons by using step functionality as directed in this link. function bindPicker() { $("input[type=text][id*=Date]").datepicker({ changeMonth: true, changeYear: true, yearRange: "-100:+0", showOn: "both", buttonImage: "../../images/Calender.png", buttonImageOnly: true, dateFormat: "M-yy" }); } 回答1: Try setting the maxDate option to

Disable DataGridView except the scroll

折月煮酒 提交于 2019-12-05 00:11:57
问题 How I can configure a datagridview so that the user can only move through the rows and use the scroll, and nothing else... If I disable the grid not allow me to use the scroll 回答1: Set your datagridview to read-only, this will disable any edits. dataGridView1.ReadOnly = true; And inside your handlers, do : void dataGridView1_DoubleClick(object sender, EventArgs e) { if (dataGridView1.ReadOnly == true) return; // .. whatever code you have in your handler... } Even if the user double-clicks on

How to access all components beneath top JFrame

社会主义新天地 提交于 2019-12-04 22:03:14
Partly for learning purposes, I made a JFrame with 4 JPanel s, 2 JLabel s, and a JMenuBar . I put various components (buttons, textboxes, textarea) into the 4 JPanels. I disabled every one of the components throughout. I then wrote two methods to try to enable everything. Worked partially. Here's the code: public void enableEverything(){ Component [] p = this.getContentPane().getComponents(); for(Component pp : p) if(pp instanceof JPanel) enableAll((JPanel) pp); } public void enableAll(JPanel p){ Component [] c = p.getComponents(); for(Component cc: c) cc.setEnabled(true); jTextArea1

How to disable prettyPhoto?

狂风中的少年 提交于 2019-12-04 07:41:30
I now how to enable prettyphoto, but the problem is how to disable? Here i enable prettyPhoto $(document).ready(function(){ $("a[rel^='prettyPhoto']").prettyPhoto({ social_tools:false, }); }); How to disable? $("a[rel^='prettyPhoto']").unbind('click'); $("a[rel^='prettyPhoto']").attr('rel', ''); Just unbind click and rel attribute. Sadly the prettyPhoto does not seem to have a "turnOff" option. If you are not using any other click event handlers for those links, @Yenne Info 's answer is just fine. If you don't want to unbind all click event handlers: Looking through the prettyPhoto code - at

How to stop a JButton going gray when disabled?

拜拜、爱过 提交于 2019-12-04 04:33:14
问题 I have to write a card game. When a card is clicked a random card image is generated but because you can only click on the card once, the button is set to be disabled after clicked. How can I stop the card image from going gray once it's clicked so that the new generated card image is clearly visible? //Actions performed when an event occurs public void actionPerformed(ActionEvent e) { if (e.getSource() == card1) { randomInteger(); card1.setIcon(cardImages[randomInt]); card1.setEnabled(false)

Text color of disabled control - how to change it

烂漫一生 提交于 2019-12-04 03:05:42
During the creation of my awesome Matching Game ;) I found a problem that is completely out of reach. When the player chooses two labels with symbols on them I want to lock all the other labels for 4 seconds. But when I do that, the forecolor of all the labels changes to grey and the symbols are visible. My question is - is there a method to change the ForeColor of a disabled label in visual c#? The project is a WinForm application. At the moment I set the color of a label in code this way: label1.ForeColor = lable1.BackColor; When the user clicks the label I change it to: lable1.ForeColor =