togglebutton怎么讀
英文原文:
toggle button
英式音標:
[ˈtɒg(ə)l] [ˈbʌt(ə)n]
美式音標:
[ˈtɑɡl] [ˈbʌtn]
commandbutton和togglebutton的區別是什么?
commandbutton和togglebutton的區別:
Command Button應用程序中使用戶通過簡單的敲擊按鈕來執行操作的一種工作方式,而toggleButton有兩種狀態。
commandbutton定義:
命令按鈕是( Command Button)應用程序中使用戶通過簡單的敲擊按鈕來執行操作的一種工作方式。當用戶選中按鈕時,不僅會執行相應操作,還會使該按鈕看上去象被按下并釋放一樣。無論何時,只要用戶單擊按鈕,就會調用 Click 事件過程。
togglebutton定義:
toggleButton有兩種狀態:選中和未選擇狀態,并且需要為不同的狀態設置不同的顯示文本。
commandbutton和togglebutton的區別是什么?
表4-5 VBA里的ActiveX控件和Visual Basic 2005里對應的Windows Forms控件ActiveX控件(VBA)Windows Forms控件(Visual Basic 2005控件)TextBoxTextBoxLabelLabelComboBoxComboBoxListBoxListBoxCheckBoxCheckBoxOptionButtonRadioButtonToggleButton不適用(可以使用CheckBox控件,并把它的Appearance屬性設為Button)CommandButtonButtonTabStripTabControlMultiPageTabControlScrollBarVScrollBar、HScrollBarSpinButtonNumericUpDownImageControl不適用(可以使用PictureBox控件代替)表4-6顯示了表4-5里列出的許多控件都有的屬性、方法和事件在名字上的改變。表4-6 Windows Forms控件常見成員的改變成員VBAVisual Basic 2005屬性CaptionText屬性ContainerParent屬性HeightHeight、Size屬性HWndHandle屬性MouPointerCursor屬性ParentFindForm方法屬性PictureImage屬性SelLengthSelectionLength屬性SelStartSelectionStart屬性SelTextSelectedText屬性ToolTipTextToolTip組件屬性WidthWidth、Size方法MoveSetBounds方法SetFocusFocus方法ZOrderBringToFront、SendToBack事件DblClickDoubleClick事件GotFocusEnter事件LostFocusLeave事件ValidateValidating除了屬性、方法和事件的不同,每個控件特有的成員也有所不同。表4-7列出了這些不同之處。表4-7 比較ActiveX控件和Windows Forms控件之間的成員控件VBAVisual Basic 2005TextBoxAlignmentTextAlignTextBoxLockedReadOnlyTextBoxChangeTextChangedLabelAlignmentTextAlignLabelBackStyle把BackColor設為透明LabelWordWrap(自動)ComboBoxListItemsComboBoxListCountCountComboBoxListIndexSelectedIndexComboBoxLockedDropDownStyle = DropDownListComboBoxStyleDropdownStyleComboBoxAddItemAdd、AddRange、InrtComboBoxRemoveItemItems.RemoveComboBoxChangeTextChangedComboBoxClickSelectedIndexChangedListBoxColumnsMultiColumn、ColumnWidthListBoxListItemsListBoxListColumnCountListBoxListIndexSelectedIndexListBoxMultiSelectSelectionModeListBoxSelCountCountListBoxSelectedGetSelected、SetSelectedListBoxAddItemAdd、AddRange、InrtListBoxRemoveItemRemoveListBoxItemCheck不適用(僅對CheckedListBox適用)CheckBoxAlignmentCheckAlignCheckBoxStyleAppearanceCheckBoxValueCheckStateCheckBoxClickCheckStateChangedOptionButtonAlignmentTextAlignOptionButtonAppearanceFlatStyleOptionButtonValueCheckedOptionButtonClickCheckedChangedFrameAppearanceFlatStyle(GroupBox)FrameClickClick(Panel)CommandButtonCancel不適用(使用Form的CancelButton代替)CommandButtonDefault不適用(使用Form的AcceptButton代替)CommandButtonValue不適用ScrollBarMaxMaximumScrollBarMinMinimumScrollBarTabIndexTabIndexChangedScrollBarTabStopTabStopChangedScrollBarValueValueChanged
togglebutton設置狀態vb
如果用戶選擇ToggleButton,則當前設置是Yes、True或On;如果用戶沒有選擇ToggleButton,則設置為No、Fal或Off。
如果ToggleButton綁定到數據源,則更改設置將更改數據源的值。禁用的ToggleButton可以顯示值,但它淡顯而且不允許在用戶界面上進行修改。
Android 的 ToggleButton樣式問題?
進行android 自定義toggle Button按鈕
很多人想做一個和iphone的,其實很簡單 但是很多人問
主要是修改樣式和圖標就好了
<ToggleButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/toggle_me"/>
<lector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true"
android:drawable="@drawable/toggle_me_on" /> <!-- presd -->
<item android:drawable="@drawable/toggle_me_off" /> <!-- default/unchecked -->
</lector>
圖片toggle_me_on 為
圖片toggle_me_off 為
不需要再進行單擊事件,只需要
toggleButton.tOnCheckedChangeListener(new OnCheckedChangeListener(){
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
toggleButton.tChecked(isChecked);
imageView.tImageResource(isChecked?R.drawable.bulb_on:R.drawable.bulb_off);
}
});就行