DataGrid.FlatModeChanged Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs when the FlatMode has changed.
public:
event EventHandler ^ FlatModeChanged;
public event EventHandler FlatModeChanged;
member this.FlatModeChanged : EventHandler
Public Custom Event FlatModeChanged As EventHandler
Event Type
Examples
The following code example demonstrates the use of this member.
// Attach to event handler.
private:
void AttachReadOnlyChanged()
{
this->myDataGrid->ReadOnlyChanged += gcnew EventHandler( this, &MyDataGridClass_FlatMode_ReadOnly::myDataGrid_ReadOnlyChanged );
}
// Check if the 'ReadOnly' property is changed.
void myDataGrid_ReadOnlyChanged( Object^ /*sender*/, EventArgs^ /*e*/ )
{
String^ strMessage = "false";
if ( myDataGrid->ReadOnly == true )
strMessage = "true";
MessageBox::Show( "Read only changed to " + strMessage, "Message", MessageBoxButtons::OK, MessageBoxIcon::Exclamation );
}
// Toggle the 'ReadOnly' property.
void button2_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
{
if ( myDataGrid->ReadOnly == true )
myDataGrid->ReadOnly = false;
else
myDataGrid->ReadOnly = true;
}
// Attach to event handler.
private void AttachReadOnlyChanged()
{
this.myDataGrid.ReadOnlyChanged += new EventHandler(this.myDataGrid_ReadOnlyChanged);
}
// Check if the 'ReadOnly' property is changed.
private void myDataGrid_ReadOnlyChanged(object sender, EventArgs e)
{
string strMessage = "false";
if(myDataGrid.ReadOnly == true)
strMessage = "true";
MessageBox.Show("Read only changed to "+strMessage,
"Message", MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
}
// Toggle the 'ReadOnly' property.
private void button2_Click(object sender, EventArgs e)
{
if(myDataGrid.ReadOnly == true)
myDataGrid.ReadOnly = false;
else
myDataGrid.ReadOnly = true;
}
' Check if the 'ReadOnly' property is changed.
Private Sub myDataGrid_ReadOnlyChanged(ByVal sender As Object, ByVal e As EventArgs) Handles myDataGrid.ReadOnlyChanged
Dim strMessage As String = "false"
If myDataGrid.ReadOnly = True Then
strMessage = "true"
End If
MessageBox.Show("Read only changed to " + strMessage, "Message", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End Sub
' Toggle the 'ReadOnly' property.
Private Sub button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button2.Click
If myDataGrid.ReadOnly = True Then
myDataGrid.ReadOnly = False
Else
myDataGrid.ReadOnly = True
End If
End Sub
Applies to
See also
Col·laboreu amb nosaltres a GitHub
La font d'aquest contingut es pot trobar al GitHub, on també podeu crear i revisar problemes i sol·licituds d'extracció. Per obtenir més informació, consulteu la nostra guia per a col·laboradors.