对于一个窗口窗体可以显示最小和最大button,而没有closuresbutton?感兴趣的读者,本文将会是一篇不错的选择,我们将详细介绍一个窗口最大化后不能对窗口进行什么操作,并为您提供关于(15)
对于一个窗口窗体可以显示最小和最大button,而没有closuresbutton?感兴趣的读者,本文将会是一篇不错的选择,我们将详细介绍一个窗口最大化后不能对窗口进行什么操作,并为您提供关于(15)各种Button 与排列 OutlineButton,ButtonBar,Expanded,RaisedButton,StadiumBorder,FlatButton.icon、android – 我应该使用ImageButton或Button?、Android的默认样式(特别是ButtonBar和ButtonBar.Button)是如何呈现的?、ASP.NET 中 Button、LinkButton和ImageButton 三种控件的使用详解的有用信息。
本文目录一览:- 一个窗口窗体可以显示最小和最大button,而没有closuresbutton?(一个窗口最大化后不能对窗口进行什么操作)
- (15)各种Button 与排列 OutlineButton,ButtonBar,Expanded,RaisedButton,StadiumBorder,FlatButton.icon
- android – 我应该使用ImageButton或Button?
- Android的默认样式(特别是ButtonBar和ButtonBar.Button)是如何呈现的?
- ASP.NET 中 Button、LinkButton和ImageButton 三种控件的使用详解
一个窗口窗体可以显示最小和最大button,而没有closuresbutton?(一个窗口最大化后不能对窗口进行什么操作)
有没有什么办法(在C#中)只显示最小化和最大化button来显示表单? 没有closuresbutton?
删除closuresbutton(我知道)的唯一方法是:
form.ControlBox = false;
但是这也摆脱了其他button。
错误模块名称:vrfcore.dll,版本:6.3.9600.16384和exception代码:0x80000003
如何在Windows 7中打开GCStress?
如何将绝对系统path转换为IShellFolder?
单声道是否支持System.Drawing和System.Drawing.Printing?
Kernel32.dll中的CreateFile不允许我打开物理磁盘
OraOLEDB.Oracle提供程序未在本地计算机上注册
你如何确定上一个修改文件的过程?
.Net核心命令行应用程序| Process.Start()在一些机器上运行,但不在其他机器上运行
我应该在哪里把configuration文件在.NET中?
LINQ程序集位于Windows XP中?
我写了一个函数做一次
public partial class Form2 : Form { public Form2() { InitializeComponent(); if (EnableMenuItem(GetSystemMenu(this.Handle,0),SC_CLOSE,MF_GRAYED) == -1) throw new Win32Exception("The message Box did not exist to gray out its X"); } private const int SC_CLOSE = 0xF060; private const int MF_GRAYED = 0x1; [DllImport("USER32")] internal static extern int EnableMenuItem(IntPtr WindowHandle,int uIDEnableItem,int uEnable); [DllImport("USER32")] internal static extern IntPtr GetSystemMenu(IntPtr WindowHandle,int bReset); }
注意alt-f4仍然可以正常工作,并在任务栏中查看时右击“关闭此窗口”。 (在Windows 7中测试)
这里有一篇文章展示了如何做到这一点。 它需要使用非托管的User32.dll
(15)各种Button 与排列 OutlineButton,ButtonBar,Expanded,RaisedButton,StadiumBorder,FlatButton.icon
效果
至于倒数第二行和倒数第一行的效果为啥一样。。可能是fluttersdk升级了。。之前的api不再生效。。算是留坑!
代码
import ''package:flutter/material.dart'';
class ButtonDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
final Widget _floatButtonDemo =
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
FlatButton(
onPressed: () {},
child: Text("FlatButton"),
splashColor: Colors.grey,
textColor: Theme.of(context).accentColor,
color: Colors.black87,
),
FlatButton.icon(
icon: Icon(Icons.add),
onPressed: () {},
label: Text("FlatButton.icon"),
splashColor: Colors.grey,
textColor: Theme.of(context).accentColor,
color: Colors.black87,
)
]);
final Widget _raisedButtonDemo =
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Theme(
// data: ThemeData(),
data: Theme.of(context).copyWith(
buttonColor: Theme.of(context).accentColor,
buttonTheme: ButtonThemeData(
textTheme: ButtonTextTheme.primary,
// shape: BeveledRectangleBorder(borderRadius: BorderRadius.circular(5.0)),
shape: StadiumBorder(),
)),
child: RaisedButton(
onPressed: () {},
child: Text("RaisedButton"),
splashColor: Colors.grey,
textColor: Theme.of(context).accentColor,
// color: Colors.white,
// textTheme: ButtonTextTheme.primary,
elevation: 0.0,
)),
SizedBox(
width: 16.0,
),
RaisedButton.icon(
icon: Icon(Icons.add),
onPressed: () {},
label: Text("RaisedButton.icon"),
splashColor: Colors.grey,
textColor: Theme.of(context).accentColor,
elevation: 12.0,
)
]);
final Widget _outerLineButtonDemo =
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Theme(
// data: ThemeData(),
data: Theme.of(context).copyWith(
buttonColor: Theme.of(context).accentColor,
buttonTheme: ButtonThemeData(
textTheme: ButtonTextTheme.primary,
// shape: BeveledRectangleBorder(borderRadius: BorderRadius.circular(5.0)),
shape: StadiumBorder(),
)),
child: OutlineButton(
onPressed: () {},
child: Text("OutlineButton"),
splashColor: Colors.grey[100],
textColor: Colors.black,
borderSide: BorderSide(color: Colors.black),
highlightedBorderColor: Colors.grey,
// textTheme: ButtonTextTheme.primary,
)),
SizedBox(
width: 16.0,
),
OutlineButton.icon(
icon: Icon(Icons.add),
onPressed: () {},
label: Text("OutlineButton.icon"),
splashColor: Colors.grey,
textColor: Theme.of(context).accentColor,
)
]);
final Widget _widthOuterLineButton = Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: 200,
child: OutlineButton(
onPressed: () {},
child: Text("_widthOuterLineButton"),
splashColor: Colors.grey,
textColor: Colors.blue,
),
)
],
);
final Widget _expendOuterLineButton = Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: OutlineButton(
onPressed: () {},
child: Text("_expendOuterLineButton"),
splashColor: Colors.grey,
textColor: Colors.blue,
),
)
],
);
final Widget _expend2OuterLineButton = Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: OutlineButton(
onPressed: () {},
child: Text("权重 for 1"),
splashColor: Colors.grey,
textColor: Colors.blue,
),
),
SizedBox(
width: 15,
),
Expanded(
//权重属性
flex: 2,
child: OutlineButton(
onPressed: () {},
child: Text("权重 for 2"),
splashColor: Colors.grey,
textColor: Colors.blue,
),
)
],
);
//一行并列行显示的按钮
final Widget _buttonBar = Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ButtonBar(
children: [
OutlineButton(
onPressed: () {},
child: Text("ButtonBar"),
splashColor: Colors.grey,
textColor: Colors.blue,
),
OutlineButton(
onPressed: () {},
child: Text("ButtonBar"),
splashColor: Colors.grey,
textColor: Colors.blue,
),
],
)
],
);
//对刚才的并排中间添加边距
final Widget _buttonBarPaddingv = Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Theme(
data: Theme.of(context).copyWith(
buttonTheme: ButtonThemeData(
padding: EdgeInsets.symmetric(horizontal: 100.0))),
child: ButtonBar(
children: [
OutlineButton(
onPressed: () {},
child: Text("ButtonBar"),
splashColor: Colors.grey,
textColor: Colors.blue,
),
OutlineButton(
onPressed: () {},
child: Text("ButtonBar"),
splashColor: Colors.grey,
textColor: Colors.blue,
),
],
),
)
],
);
return Scaffold(
appBar: AppBar(
title: Text("button Demo"),
elevation: 0.0,
),
body: Container(
padding: EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
_floatButtonDemo,
_raisedButtonDemo,
_outerLineButtonDemo,
_widthOuterLineButton,
_expendOuterLineButton,
_expend2OuterLineButton,
_buttonBar,
_buttonBarPaddingv
],
),
),
);
}
}
android – 我应该使用ImageButton或Button?
解决方法
例如:my_button.xml
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/button_style1_active" /> <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/button_style1_down" /> <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/button_style1_down" /> <item android:drawable="@drawable/button_style1_up" /> </selector>
在layout.xml中使用:
<Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Tap me" android:background="@drawable/my_button"/>
使用此配置,您可以影响按钮的外观,按下,聚焦等.它们对于两种类型的按钮(Button和ImageButton)都是一样的.如果您的按钮不包含文本,请使用ImageButton.
Android的默认样式(特别是ButtonBar和ButtonBar.Button)是如何呈现的?
我看到了对这些样式的引用:
https://www.jb51.cc/tag/buttonbar/" target="_blank">buttonbarStyle"https://www.jb51.cc/tag/buttonbar/" target="_blank">buttonbarButtonStyle"
所以我打开了Android的attrs.xml,这就是我所看到的:
<!-- Style for buttons within button bars --> <attr name="buttonbarButtonStyle" format="reference" /> <!-- Style for button bars --> <attr name="buttonbarStyle" format="reference" />
而已.所以也许这是一种风格,对吧?这是styles.xml:
<style name="Widget.Holo.buttonbar"> <item name="android:divider">?android:attr/dividerVertical</item> </style> <style name="Widget.Holo.buttonbar.Button"> </style>
咦?然而Eclipse和设备能够像这样呈现它们:
那么如何获得正确的尺寸和东西呢?我需要它们的原因是我想在Gingerbread及其下面使用这种类型的按钮栏,它缺少buttonbarStyle属性.因此,他们犯了错误:
解决方法
ASP.NET 中 Button、LinkButton和ImageButton 三种控件的使用详解
ASP.NET Framework包含三个用于向服务器端提交表单的控件:Button、LinkButton和ImageButton。这三个控件拥有同样的功能,但每种控件的外观界面不同。
本文就带着大家学习如何在页面中使用这三种控件。然后,学习如何关联客户端脚本和服务器端Button控件,以及如何使用Button控件把一个表单传到不是当前页的页面。最后,学习如何处理Button控件的Command事件。
一、使用Button控件
Button控件用来向服务器端提交表单的按钮。例如,代码清单1中的页面包含一个Button控件。点击这个Button控件,则更新由Label控件显示的时间(见图1)。
代码清单1 ShowButton.aspx
<form id="form1" runat="server">
<div>
<asp:Button id="btnSubmit" Text="Submit" OnClick="btnSubmit_Click" Runat="server" /> <br /><br />
<asp:Label id="lblTime" Runat="server" />
</div>
</form>
图1 显示Button控件
Button控件支持下列属性(不完全列表):
·AccessKey——指定一个导向Button控件的键。
·CommandArgument——用于指定传给Command事件的命令参数。
·CommandName——指定传给Command事件的命令名。
·Enable——用于禁用该Button控件。
·OnClientClick——指定点击按钮时执行的客户端脚本。
·PostBackUrl——用于设置将表单传给某个页面。
·TabIndex——设置Button控件的Tab顺序。
·Text——用于标注Button控件。
·UseSubmitBehavior——用于使用JavaScript回传表单。
Button控件支持下面的方法:
·Focus()——用于把初始表单焦点设为该Button控件。
Button控件还支持下面两个事件:
·Click——点击Button控件时引发。
·Command——点击Button控件时引发。CommandName和CommandArgument传给这个事件。
二、使用LinkButton控件
LinkButton控件象Button控件一样,用于把表单回传给服务器端。但是,不像Button控件生成一个按钮,LinkButton控件生成一个链接。
代码清单2包含了一个简单的表单。这个表单包含一个LinkButton控件,用于向服务器端提交表单并显示表单字段的内容(见图2)。
代码清单2 ShowLinkButton.aspx
<form id="form1" runat="server">
<div>
<asp:Label id="lblFirstName" Text="First Name:" AssociatedControlID="txtFirstName" Runat="server" /> <br />
<asp:TextBox id="txtFirstName" Runat="server" /><br /><br />
<asp:Label id="lblLastName" Text="Last Name:" AssociatedControlID="txtLastName" Runat="server" /><br />
<asp:TextBox id="txtLastName" Runat="server" /><br /><br />
<asp:LinkButton id="lnkSubmit" Text="Submit" OnClick="lnkSubmit_Click" Runat="server" /><br /><br />
<asp:Label id="lblResults" Runat="server" />
</div>
</form>