button

how to change button template dynamically WPF

*爱你&永不变心* 提交于 2020-01-11 04:20:08
问题 How can I change a Button template dynamically? I have a ComboBox where by changing his selected value I want to change a Button Template . This is what I have been trying to do: <Window.Resources> <ControlTemplate x:Key="ButtonControlTemplate1" TargetType="{x:Type Button}"> <Grid> <Rectangle Fill="#FF2D2D7A" Margin="7.5,9.5,8.5,11" Stroke="Black" RadiusX="45" RadiusY="45" StrokeThickness="6"/> </Grid> </ControlTemplate> <ControlTemplate x:Key="ButtonControlTemplate2" TargetType="{x:Type

What's the difference between <input type=“button” /> and <button>?

為{幸葍}努か 提交于 2020-01-10 19:52:06
问题 I didn’t know about the <button> tag until today. 回答1: Basically, <button> is more flexible as it can contain other tags inside it. Like, <button type="submit"><strong>Click</strong> me, <em>user!</em></button> You won't be able to do this with regular <input> . 回答2: Check this article Inputs vs Buttons Buttons created with the BUTTON element function just like buttons created with the INPUT element, but they offer richer rendering possibilities: the BUTTON element may have content. For

Where is Button.DialogResult in WPF?

寵の児 提交于 2020-01-10 17:29:27
问题 In System.Windows.Forms.Button there is a property DialogResult, where is this property in the System.Windows.Controls.Button (WPF)? 回答1: There is no built-in Button.DialogResult, but you can create your own (if you like) using a simple attached property: public class ButtonHelper { // Boilerplate code to register attached property "bool? DialogResult" public static bool? GetDialogResult(DependencyObject obj) { return (bool?)obj.GetValue(DialogResultProperty); } public static void

How to create button in Action bar in android

穿精又带淫゛_ 提交于 2020-01-10 08:49:08
问题 I am working on android application where i need a button in action bar. These are my activity and java files. So, i need a button at right side of my tool bar. Thanks in advance. content_b2_bdeliveries.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"

Circle button css

旧城冷巷雨未停 提交于 2020-01-10 07:52:11
问题 I'm a beginner and very confused, as a div tag when I give the same width and height with border-radius: 50% it always becomes circle. but with the tag a in case I want to make a circle button, It doesnt work that way. This is when I try to make a circle border button clickable. <a class="btn" href="#"><i class="ion-ios-arrow-down"></i></a> .btn { height: 300px; width: 300px; border-radius: 50%; border: 1px solid red; } 回答1: For div tag there is already default property display:block given by

MouseHover and MouseLeave don't work when the control is invisible

安稳与你 提交于 2020-01-10 05:42:25
问题 For some reason MouseHover and MouseLeave functions behave really strange. All I need to do is, when the cursor is over the "button", I want to make the button visible and when the cursor leaves the button, I want to make it invisible. Whatever I try I couldn't make it work. It seems like Mouse events not working when the control object is invisible. private void button1_MouseHover(object sender, EventArgs e) { button1.Visible = true; } private void button1_MouseLeave(object sender, EventArgs

Why use list to do navigation menu instead of buttons?

拜拜、爱过 提交于 2020-01-10 05:16:06
问题 I have inspected many navigation menus on the internet, and they often use lists instead of a button. What is the reason behind this? Why use the button? Thank you. 回答1: There are (at least) two good reasons to use lists. Using lists can help to give an idea of your site's structure which is good in terms of SEO but also if people use either custom CSS or screen readers for accessibility reasons. The second and slightly related one is that it's rather helpful when it comes to creating

How to add a StackPanel in a Button in C# code behind

痞子三分冷 提交于 2020-01-10 04:45:06
问题 How to add a StackPanel in a Button using c# code behind (i.e. convert the following XAML to C# )? There is no Button.Children.Add ... <Button> <StackPanel Orientation="Horizontal" Margin="10"> <Image Source="foo.png"/> </StackPanel> </Button> 回答1: Set Button.Content instead of using Button.Children.Add As a longer explanation: Button is a control which "only has 1 child" - its Content . Only very few controls (generally "Panels") can contain a list of zero or more Children - e.g. StackPanel,

C# Windows Form Application Transparent button

不打扰是莪最后的温柔 提交于 2020-01-10 03:54:27
问题 I'm new to C#. I'd like to create an invisible button, but they are click-able in C# windows form application. Is there a way? I tried BackColor to Transparent, but that does not change the fact that it is transparent 回答1: Its simple try this. Click the button that you want to make transparent. Select FlatStyle from Properties and set it to popup Now change the BackColor property to Transparent . This will make the button transparent. However if you want to make it transparent over a

Calling Code-behind from Javascript

我的梦境 提交于 2020-01-10 03:15:09
问题 On the click of a button, I call a JavaScript function. After getting the value, I need to perform some stuff from the value obtained in the code-behind. How should I call code-behind? My aspx: function openWindow(page) { var getval = window.showModalDialog(page); document.getElementById("<%= TxtInput.ClientID %>").value = getval; //After this I need to perform stuff 'Upload(TxtInput.value)' into database from the code-behind } The button calling the function is set up in the following manner