Trusted Authentication
Data Source=ServerName; Initial Catalog=DatabaseName; Integrated Security=SSPI;
Data Source=ServerName; Initial Catalog=DatabaseName; Integrated Security=SSPI;
$("select#Club").val();
$('select#Club option:selected').text(); 以上2方法在單選時相同,但複選時,
val()會用逗號分開 ex. AA, BB
text()不會 ex. AABB
$("select#Club").children("[@selected]").each(function(){
alert(this.text());
});$("#select1").children().each(function(){
if ($(this).text()=="option you want"){
//jQuery給法
$(this).attr("selected", true); //或是給"selected"也可
//javascript給法
this.selected = true;
}
});var option = jQuery("new option");
$('select#Club').append(option);
$(option).attr("selected","true"); //讓option為selected
$('select#Club').trigger("change"); //最後要觸發select的change事件
$('select#Club')[0].selectedIndex = 1;//不知為何要加[0]=========== K. T. Chen 提到 ==========================
在$("")加[0]的意思是把jQuery物件轉為DOM物件。這樣子jQuery物件才能使用DOM底下的selectedIndex方法。
$("select#Club").change(function(){ //事件發生
//一次印出
alert($(this).val());
//印出選到多個值
jQuery('option:selected', this).each(function(){
alert(this.value);
});
});$('select#Clubs option:selected').remove();
//純javascirpt<select onchange="alert('Index: ' + this.selectedIndex
+ '\nValue: ' + this.options[this.selectedIndex].value)">
...
</select>
if ( this .WindowState == FormWindowState.Minimized)
this .Visible = false ; }
const int WM_SYSCOMMAND = 0x112 ;
const int SC_CLOSE = 0xF060 ;
const int SC_MINIMIZE = 0xF020 ;
const int SC_MAXIMIZE = 0xF030 ;
protected override void WndProc( ref Message m)
{
if (m.Msg == WM_SYSCOMMAND)
{
if (m.WParam. ToInt32() == SC_MINIMIZE)
{
this .Visible = false ;
return ; }
}
base .WndProc( ref m); }