Nota:
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
Obtiene un valor que determina si DataRepeaterItem es el elemento actualmente seleccionado en un control de DataRepeater .
Espacio de nombres: Microsoft.VisualBasic.PowerPacks
Ensamblado: Microsoft.VisualBasic.PowerPacks.Vs (en Microsoft.VisualBasic.PowerPacks.Vs.dll)
Sintaxis
'Declaración
<BrowsableAttribute(False)> _
Public ReadOnly Property IsCurrent As Boolean
[BrowsableAttribute(false)]
public bool IsCurrent { get; }
[BrowsableAttribute(false)]
public:
property bool IsCurrent {
bool get ();
}
[<BrowsableAttribute(false)>]
member IsCurrent : bool
function get IsCurrent () : boolean
Valor de propiedad
Tipo: System.Boolean
true si DataRepeaterItem es el elemento actualmente seleccionado; si no, false.
Comentarios
Cuando IsCurrent es igual a True, la propiedad de ItemIndex de DataRepeaterItem es igual que la propiedad de CurrentItemIndex de control de DataRepeater .
Ejemplos
El ejemplo siguiente muestra cómo usar el controlador de eventos de DrawItem para mostrar un indicador de selección cuando un elemento está seleccionado.Se supone que tiene un formulario que contiene DataRepeater enlazado denominado DataRepeater1 que contiene también un control independiente de PictureBox denominado SelectedPictureBox.
Private Sub DataRepeater1_DrawItem(
ByVal sender As Object,
ByVal e As Microsoft.VisualBasic.PowerPacks.DataRepeaterItemEventArgs
) Handles DataRepeater1.DrawItem
' If this is the selected item.
If e.DataRepeaterItem.IsCurrent Then
' ...display the PictureBox.
e.DataRepeaterItem.Controls("SelectedPictureBox").
Visible = True
Else
' Otherwise, hide the PictureBox.
e.DataRepeaterItem.Controls("SelectedPictureBox").
Visible = False
End If
End Sub
private void dataRepeater1_DrawItem(object sender,
Microsoft.VisualBasic.PowerPacks.DataRepeaterItemEventArgs e)
{
// If this is the selected item...
if (e.DataRepeaterItem.IsCurrent)
// ...display the PictureBox.
{
e.DataRepeaterItem.Controls["selectedPictureBox"].Visible = true;
}
else
{
// Otherwise, hide the PictureBox.
e.DataRepeaterItem.Controls["selectedPictureBox"].Visible = false;
}
}
Seguridad de .NET Framework
- Plena confianza para el llamador inmediato. Un código de confianza parcial no puede utilizar este miembro. Para obtener más información, vea Utilizar bibliotecas de código que no es de plena confianza.
Vea también
Referencia
Microsoft.VisualBasic.PowerPacks (Espacio de nombres)