台灣最大程式設計社群網站
∣
免費加入會員
∣登入
∣回首頁∣
您好
線上人數
1725
會員總數:
246213
討論主題:
189782
討論區
程式下載/上傳
科技新聞
專欄文章
會員中心
加值服務
外包接案
求職求才
登入
登出
歡迎您
免費
加入會員
討論區選單
新手必讀
我要提問!!
討論區
個人討論區
我的關注主題
我的黑名單
討論區EP英雄榜
專家等級說明
討論區常見問題
兌換發問點數QP
扣點申請加值服務
申請版主
開發工具
ASP
ASP.NET
C#
VB.NET
VB6
C/C++
PHP
Java
Java Script/ Node.js
AJAX / JSON / jQuery
其他語言
行動裝置開發
Android APP 開發
iOS APP/ swift 開發
Windows Phone APP
資料庫
ACCESS
MS SQL
MySQL
Oracle
其他DB
多媒體 / 網管
CSS/HTML5/Bootstarp
影像處理
office VBA / WinOS
Windows 伺服器
Linux / Unix
網管 / 資安 / VM
硬體 / 週邊 / 其他
綜合
求職求才
外包接案
心情甘苦談
網站經營 / 合夥 / 證照
建言 / 公告
文章區
專欄文章
科技新聞
Blog精華文章
討論區列表
>>
CSS/HTML5/Bootstarp
>> CheckBox 打了勾勾後,它會亂跑
[]
[
我要回覆
]
CheckBox 打了勾勾後,它會亂跑
價值 : 200 QP
點閱數:1810 回應數:0
樓主
fet
0
46
1368
83
發送站內信
各位前輩:
我將UserName_2及UserName_3 , 打勾後 , 將Scorbar or 滑鼠滾動上下列 ,
那個勾勾會亂跑...
要如何修改呢??
謝謝
xaml
<Grid x:Name="LayoutRoot" Background="White"> <ListBox Grid.Row="1" Name="ListBox1" Height="250" Width="200"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <CheckBox Tag="{Binding UserId}" Content="{Binding UserName}" Margin="0,10,0,0" FontSize="14" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="12,0,0,0" Name="Button1" VerticalAlignment="Top" Width="75" /> </Grid>
VB Code
Partial Public Class MainPage Inherits UserControl Public Sub New() InitializeComponent() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click Dim UserCollection As New System.Collections.ObjectModel.ObservableCollection(Of clsUser) For i As Integer = 0 To 30 UserCollection.Add(New clsUser With {.UserId = i, _ .UserName = "UserName_" & i}) Next ListBox1.ItemsSource = UserCollection End Sub Public Class clsUser Implements System.ComponentModel.INotifyPropertyChanged Private _UserId As String Private _UserName As String Public Property UserId() As String Get Return Me._UserId End Get Set(ByVal value As String) Me._UserId = value RaiseEvent PropertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs("UserId")) End Set End Property Public Property UserName() As String Get Return Me._UserName End Get Set(ByVal value As String) Me._UserName = value RaiseEvent PropertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs("UserName")) End Set End Property Public Event PropertyChanged(ByVal sender As Object, ByVal e As System.ComponentModel.PropertyChangedEventArgs) Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged End Class End Class
本篇文章發表於2011-03-14 07:50
目前尚無任何回覆
回覆
如要回應,請先
登入
.
|
網站導覽
|
網站介紹
|
4P點數說明
|
電子報
|
小舖活動
|
大事紀
|
廣告刊登
|
常見問題
|
聯絡我們
|
版權所有 ©copyright 2000 All Rights Reserved