button

How do I make an HTML button’s onclick event trigger one of two different functions at random?

How do I make an HTML button’s onclick event trigger one of two different functions at random? I’m using PHP on the server, and jQuery on the client. Using this code when i click the button image nothing happens... function a(){ alert('A got called!'); } function b(){ alert('B got called!'); } $('#button').bind('click...

CSS: I can't put a button in the middle of a DIV element.

I'm using CSS buttons from this tutorial: http://www.oscaralexander.com/tutorials/how-to-make-sexy-buttons-with-css.html I need to put a button in the middle of a DIV so it's centered. But I can't! Here's the code of the button: <a class="button" href="#"><span>Bring world peace</span></a> And here's CSS: .clear { /* generic con...

How to open an app from a browser?

Amazon has the button that opens an app as follows. Clicking this button opens a 'Amazon Kindle', for my case, 'Amazon Kindle for Mac'. How is this possible? I mean, how can I program to do this job? It's definitely not Flash. I tried to use button to open an App using button provided by HTML, but I couldn't make it because of the s...

Creating a C# WPF Image Button with a template that I can alter in code dynamically

Hey, I was figuring out how to create an image button template in C# WPF, and I came upon this . This seems really useful to me except for two problems: I want to be able to change the images dynamically in the C# codebehind, as this button will be using images that I am loading dynamically through XML documents. FIXED I'm getting the ...

WPF MenuItem vs Button behavior in new window when mouse still down

I didn't know how to make the 'issue' (different behavior) more clear in the title, but I'll explain here. In our WPF application, we're using the DataGrid control to list a number of entities. After double clicking a row, we open a new Window and in that Window, there are among other things a couple of MenuItem controls. The problem i...

Making a <button> that's a link in HTML

Basically, I like the way that <input type="submit"> is styled, with the clickable button when you add a little CSS. However, regular buttons are not styled as such, they have no such clickability without some major CSS or JS, and you have to use images. I made submit buttons into links, by using the form action, but this requires me to...

How to change the Title of a view.

hi everyone, So, I have two views and i want to give at my NavigationBar the name of a Label in my first view... And i have an other, in my .xib, i have many button and Label and on the top a "+" button(in a Navigation Bar) (i'm not in a TableView) and my question is, when the first Label is completed, how when i press again the "+" b...

Getting resized images inside Android buttons

Hi I want to design a TableLayout with some big buttons with icon and text embbeded. I have found some similar question but not the same 1. My simplified XML layout is: <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_pa...

WPF/MVVM: Weird behaviour of wpf buttons with Commands disabling

Hello, just some code...: Question is at bottom. XAML: <StackPanel Orientation="Horizontal"> <Button Content="Start" Command="{Binding FirstDateCommand}" /> <Button Content="Back" Command="{Binding PreviousDateCommand}" /> <DatePicker SelectedDate="{Binding SelectedDate}" DisplayDateStart="{Binding...

C# - Multilingual string for "Cancel"

Hey I want to make multilingual buttons, like those of the messagebuttons. I have a form with a cancel-button, but I want to have a multilingual text. For example, in German it is named "Abbrechen, in French "Annuler" and in English "Cancel". Like for MessageBoxes, those buttons are also multilingual. Is it possible to find out the stri...

WPF button background in windows 7

Hi I had windows xp before and setting the wpf button background always worked but since windows 7 the background is always set to blue. How could i fix this? ...

How do I change the size of an HBox in Flex to fit it's container?

I create an HBox, fill it with a grid of buttons, and set the scroll policy. When I resize the window, the stage changes size, and so does the HBox ... to a point. Once it reaches the height of the Grid it contains, it stops shrinking, like it has a "min-height". This ruins the scrollbar that I'm trying to establish in this case. I've ...

how can I disable windows key in c#?

How can i disable or lock windows button? ...

Treeview hide [+] [-] buttons

Does anyone know how to hide the [-] button for a treeview? The treeview will never be collapsed, and therefore I dont need the root node to have the collapse option. I know I could use a listview with a stye that indents the [0] element to act like a treeview root node. However the binding I'm using etc. kind of asks for a treeview, and...

share this button problem

H. I have used the code from sharethis.com to add the social media feature on my website. But when i click on facebook and share it, I am getting the message "your message was successfully shared" and beneath that i am getting sharethis.com promotion as Get this button, which does not look nice. I saw this website, http://breakstonestr...

Multiple Actions to 1 button in iPhone sdk

What I'm trying to do is, I have a button that opens up the photo library so the user can choose the photo and then the photo is then displayed on another view (another .xib file). How can I do this? Right now, I have both the photo library action and change view action pointing towards the button and its crashing due to both actions hap...

Windows Themes ButtonChrome Border

Hi I have created my own button based on icrosoft_Windows_Themes2:ButtonChrome. I want to get rid of the default border and i've tried setting it to null or transparent but still i get a white border. Here's my markup: <Microsoft_Windows_Themes2:ButtonChrome x:Name="ibAero" Visibility="Collapsed" SnapsToDevicePixels="true" Height="{T...

Flash disable a button/movie clip, not working?

I am using Greensock to tween and during a rollOver I need to disable some buttons. I am pretty sure the code is right but the buttons do NOT disable? code: import com.greensock.*; btn_skins.addEventListener(MouseEvent.CLICK, function() { TweenLite.to(mtvOrange, .25, {y:0}); } ); btn_teenwolf.addEventListener(MouseEv...

How to add a simple button actionscript

Hi, I am using Adobe Flash CS4. I don't know why I do the sample actionscript code here. on (release) { gotoAndPlay(1); } And now I'm dealing with a button function. I already created a box then press "F8" and choose button. Now I click on the button box, and press "F9" for the actionscript. It said that "Current selection cannot...

Android - play sound on button click - Null pointer exception

I am trying to play a sound file on the click of a button. The sound is just 1 sec long. It plays well the first few times I click the button, but after a while it gives a NullPointerException. Here's the code: button[i].setOnClickListener(new OnClickListener() { public void onClick(View view) { mp = ...