DataRepeater.SelectionColorChanged (Evento)
Se produce cuando cambia la propiedad SelectionColor.
Espacio de nombres: Microsoft.VisualBasic.PowerPacks
Ensamblado: Microsoft.VisualBasic.PowerPacks.Vs (en Microsoft.VisualBasic.PowerPacks.Vs.dll)
Sintaxis
'Declaración
Public Event SelectionColorChanged As EventHandler
public event EventHandler SelectionColorChanged
public:
event EventHandler^ SelectionColorChanged {
void add (EventHandler^ value);
void remove (EventHandler^ value);
}
member SelectionColorChanged : IEvent<EventHandler,
EventArgs>
JScript no admite eventos.
Comentarios
Utilice este evento para ejecutar código cuando el SelectionColor se cambia la propiedad de un elemento de encabezado en tiempo de ejecución.
Para obtener más información acerca de cómo controlar eventos, vea Controlar y provocar eventos.
Ejemplos
En el ejemplo siguiente se muestra cómo responder a la SelectionColorChanged eventos.
Private Sub DataRepeater1_SelectionColorChanged(
) Handles DataRepeater1.SelectionColorChanged
Dim ColorString As String = DataRepeater1.SelectionColor.ToString
Dim BracketPosition As Integer
' Find the left bracket.
BracketPosition = InStr(ColorString, "[")
' Find the color name.
ColorString = Microsoft.VisualBasic.Right(ColorString,
Len(ColorString) - BracketPosition)
ColorString = Microsoft.VisualBasic.Left(ColorString,
Len(ColorString) - 1)
' Display a message.
MsgBox("Selections will be indicated by a " & ColorString &
" header.")
End Sub
private void dataRepeater1_SelectionColorChanged(object sender, System.EventArgs e)
{
StringBuilder MyStringBuilder = new StringBuilder(dataRepeater1.SelectionColor.ToString());
string searchWithinThis = dataRepeater1.SelectionColor.ToString();
// Find the color name.
string searchForThis = "[";
int firstCharacter = searchWithinThis.IndexOf(searchForThis);
MyStringBuilder.Remove(0, firstCharacter + 1);
MyStringBuilder.Replace(']', ' ');
// Display a message.
MessageBox.Show("Selections will be indicated by a " + MyStringBuilder + "header.");
}
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)