我有一个使用类formBtn的按钮
在css
.formBtn {color:#fff; background-color:#518ACD; border-color:#ccc #000 #000 #ccc; font- size:11px; font-weight:bold;}
Run Code Online (Sandbox Code Playgroud)
在HTML中
<html:submit styleClass="formBtn" value="Add"/>
Run Code Online (Sandbox Code Playgroud)
建议我,以便我可以使用相同的类名称为禁用按钮,并以不同的方式显示它(比如背景颜色:灰色).我可能正在使用这样的样式类
在HTML中
<html:submit styleClass="formBtn" value="Disabled Add" disabled="true"/>
Run Code Online (Sandbox Code Playgroud) 我在Asp.Net网站上有一个名为'member'的角色和另一个'admin'.
我之前做过,那个按钮应该是可见的或者我没有成功,但是,我无法获得正确的代码(aspx.cs)来禁用按钮,以便它可以在视图中但根本不可访问.
<asp:Button ID="Button4" runat="server" PostBackUrl="~/report.aspx"
Text="print in report format" Width="173px"
Enabled='<%# HttpContext.Current.User.IsInRole("Admin") %>' />
Run Code Online (Sandbox Code Playgroud)
我希望每当成员登录时,应该禁用"报告"按钮.
在我的方法doWork()我打电话
SwingUtilities.invokeLater(new Runnable(){
public void run() {
button.setBackgroundColor(Color.red);
}
});
Run Code Online (Sandbox Code Playgroud)
然后我打电话
SwingUtilities.invokeLater(new Runnable(){
public void run() {
button.setBackgroundColor(Color.blue);
}
});
Run Code Online (Sandbox Code Playgroud)
问题是按钮是红色然后是蓝色,还是蓝色然后是红色?
我的WPF窗口中有许多按钮,我希望按钮内容中的某些字符加下划线.
我尝试使用像"My_Content"这样的"_"来强调C,但是直到用户点击Alt键或者更改了本地设置才会出现这种情况.当我尝试仅为部分内容加下划线时,在Content属性中使用<Underline>会导致错误,例如:
Content ="我的<Underline> C </ Underline> ontent".
如果可能的话,我宁愿在XAML中设置它.任何帮助,将不胜感激.
谢谢!
我正在使用Visual c#express 2010,我有3个选项卡,在第一个选项卡上有一个退出程序的按钮.我正试着用第二个和第三个标签点击该按钮
btnExit.PerformClick();
Run Code Online (Sandbox Code Playgroud)
但由于它不可见,所以没有任何反应.如何调用隐形按钮单击?
任何帮助,将不胜感激
编辑:感谢您的回复,这两个答案很有效,但我找到了一种更简单,更好的方法.
而不是系统地改变标签或调用一个完全不同的方法,我这样做了
btnExit_Click(sender, e);
Run Code Online (Sandbox Code Playgroud)
我可以把它放在任何其他按钮点击它,它很好,非常简单.
是否可以在Graph API中发布带有共享按钮的消息.我使用SDK-PHP v3和这段代码:
$args = array(
'access_token' => TOKEN_HERE,
'message' => 'message here',
'link' => 'http://www.example.com/',
'caption' => 'caption here'
);
$result = $facebook->api("/me/feed", "post", $args);
Run Code Online (Sandbox Code Playgroud)
它工作正常但共享按钮丢失.有一个评论和像按钮但没有分享按钮.请不要给我任何教程或fecebook文档的链接.如果你知道如何做到这一点,或者你知道不可能只写它.谢谢!
我正在尝试创建一个函数,在用户单击按钮时添加其他文本字段.它的工作方式是实际上有四个文本字段和三个按钮.使用"display:none"隐藏四个文本字段中的三个,并隐藏三个按钮中的两个.单击按钮1时,显示文本字段2和按钮2,单击按钮2时,文本字段3和按钮3显示,依此类推.这可以通过手动输入代码来管理,但在必须创建许多文本字段时会成为负担.到目前为止,我已经使用了这段代码:
<html>
<head>
<style type="text/css">
.hide {display:none;}
</style>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#add"+2 ).click(function(){
$("#add"+2).hide();
$("#text"+2).show();
$("#add"+3).show();
});
$("#add"+3 ).click(function(){
$("#add"+3).hide();
$("#text"+3).show();
$("#add"+4).show();
});
$("#add"+4 ).click(function(){
$("#add"+4).hide();
$("#text"+4).show();
});
});
</script>
</head>
<body><div id="border">
<form action="" method="post">
<table>
<tr>
<td>
<input type="text" id="text1" name="text1" />
</td>
<td>
<input type="button" id="add2" name="add" value="add another field" />
<input type="button" id="add3" class="hide" name="add" value="add another field" />
<input type="button" id="add4" class="hide" name="add" value="add another field" />
</td>
</tr>
<tr>
<td>
<input …Run Code Online (Sandbox Code Playgroud) 我正在将一个SDE要素类添加到ArcMap中,在添加之前,我必须单击"连接详细信息"窗口中的" 确定"按钮.有没有办法按代码点击确定按钮?我想也许可以通过使用Window通知代码(例如下面的代码)来完成,但是我没有看到按钮单击" 确定"或"取消"的任何选项.也许它可以通过"Windows.Forms.DialogResult.Ok"以某种方式或通过获得确定按钮的焦点来完成?
谢谢
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const WM_CLOSE = &H10
'Close SDE connection details dialog
Dim WinWnd As Long, Ret As String
'Ask for a Window title
Ret = "Connection Details"
If Ret …Run Code Online (Sandbox Code Playgroud) 我在Android应用程序中使用ScrollView具有以下XML布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="fill_parent">
<TextView.../>
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/linearLayout1">
<CheckBox ...>
<requestFocus></requestFocus>
</CheckBox>
<CheckBox ..></CheckBox>
</LinearLayout>
<ScrollView android:layout_width="match_parent" android:layout_height="wrap_content" >
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical">
<TextView android:text="Block Type:" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<RadioGroup android:orientation="horizontal" android:id="@+id/inputType" android:layout_width="wrap_content" android:layout_height="wrap_content">
<RadioButton android:id="@+id/btCall" android:paddingRight="10px" android:text="Call" android:layout_height="wrap_content" android:layout_width="wrap_content" android:checked="true"></RadioButton>
<RadioButton android:id="@+id/btSMS" android:paddingRight="10px" android:text="SMS" android:layout_height="wrap_content" android:layout_width="wrap_content"></RadioButton>
<RadioButton android:id="@+id/btBoth" android:paddingRight="10px" android:text="Call + SMS" android:layout_height="wrap_content" android:layout_width="wrap_content"></RadioButton>
</RadioGroup>
<Button android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/chooseContactButton" android:text="Choose from contacts..."></Button>
<TextView android:text="Name:" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="textPersonName" android:id="@+id/inputName">d</EditText>
<TextView android:text="Number:" android:layout_width="wrap_content" …Run Code Online (Sandbox Code Playgroud) 我有几个按钮,点击时我不希望它们得到焦点,我也不希望空格键再次"按下"它们.
我想要与Windows计算器中的按钮相同的功能.
谷歌搜索和搜索堆栈一切似乎是关于形式,例如.使表单无法在C#中聚焦
我知道我应该重写WndProc但不完全确定如何处理我应该捕获/忽略的消息等等.据我所知:
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
}
Run Code Online (Sandbox Code Playgroud)