Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.
MyMessageBoxService svc = new MyMessageBoxService(spreadsheetControl1, spreadsheetControl1.LookAndFeel);
spreadsheetControl1.ReplaceService<DevExpress.XtraSpreadsheet.Services.IMessageBoxService>(svc);
usingSystem.Windows.Forms;
usingDevExpress.LookAndFeel;
usingDevExpress.XtraEditors;
usingDevExpress.Spreadsheet;
using DevExpress.Portable;
// ...classMyMessageBoxService : DevExpress.XtraSpreadsheet.Services.IMessageBoxService
{
readonly Control control;
readonly UserLookAndFeel lookAndFeel;
publicMyMessageBoxService(Control control, UserLookAndFeel lookAndFeel)
{
this.control = control;
this.lookAndFeel = lookAndFeel;
}
// To test: select a range of cells with and without data validation settings and click Data Validation command to invoke the Data Validation dialog.public PortableDialogResult ShowYesNoCancelMessage(string message) {
string myMessage = "Aktion auswählen\n\n" + message;
return (PortableDialogResult)XtraMessageBox.Show(lookAndFeel, control, myMessage, Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information);
}
// To test: enter incorrect data into a cell with a data validation rule applied.public PortableDialogResult ShowDataValidationDialog(string message, string title, DataValidationErrorStyle errorStyle) {
string myMessage = "Der eingegebene Wert ist ungültig.\n\n" + message;
MessageBoxButtons buttons;
MessageBoxIcon icon;
if(errorStyle == DataValidationErrorStyle.Stop) {
buttons = MessageBoxButtons.RetryCancel;
icon = MessageBoxIcon.Error;
} elseif(errorStyle == DataValidationErrorStyle.Warning) {
buttons = MessageBoxButtons.YesNoCancel;
icon = MessageBoxIcon.Warning;
} else {
buttons = MessageBoxButtons.OKCancel;
icon = MessageBoxIcon.Information;
}
return (PortableDialogResult)XtraMessageBox.Show(lookAndFeel, control, myMessage, title, buttons, icon);
}
// To test: click the Test button or try to set the row height to 1000.public PortableDialogResult ShowMessage(string message, string title, PortableMessageBoxIcon icon) {
string myMessage = "Ein Fehler tritt auf.\n\n" + message;
var myIcon = (MessageBoxIcon)icon;
return (PortableDialogResult)XtraMessageBox.Show(lookAndFeel, control, myMessage, title, MessageBoxButtons.OK, myIcon);
}
// To test: drag and drop cells to another location trying to overwrite the content of the destination cells.publicboolShowOkCancelMessage(string message)
{
string myMessage = "Möchten Sie diesen Vorgang wirklich ausführen?\n\n" + message;
return PortableDialogResult.OK == (PortableDialogResult)XtraMessageBox.Show(lookAndFeel, control, myMessage, Application.ProductName, MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
}
// To test: try to delete a defined name in the Name Manager dialog.publicboolShowYesNoMessage(string message)
{
string myMessage = "Entscheidung treffen. Ja oder Nein?\n\n" + message;
return PortableDialogResult.Yes == (PortableDialogResult)XtraMessageBox.Show(lookAndFeel, control, myMessage, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
}
}
Dim svc AsNew MyMessageBoxService(spreadsheetControl1, spreadsheetControl1.LookAndFeel)
spreadsheetControl1.ReplaceService(Of DevExpress.XtraSpreadsheet.Services.IMessageBoxService)(svc)
ImportsDevExpress.LookAndFeelImportsDevExpress.XtraEditorsImportsDevExpress.SpreadsheetImports DevExpress.Portable
' ...FriendClass MyMessageBoxService
Implements DevExpress.XtraSpreadsheet.Services.IMessageBoxService
PrivateReadOnly control As Control
PrivateReadOnly lookAndFeel As UserLookAndFeel
PublicSubNew(ByVal control As Control, ByVal lookAndFeel As UserLookAndFeel)
Me.control = control
Me.lookAndFeel = lookAndFeel
EndSub' To test: select a range of cells with and without data validation settings and click Data Validation command to invoke the Data Validation dialog.PublicFunction ShowYesNoCancelMessage(ByVal message AsString) As PortableDialogResult Implements DevExpress.XtraSpreadsheet.Services.IMessageBoxService.ShowYesNoCancelMessage
Dim myMessage AsString = "Aktion auswählen" & ControlChars.Lf & ControlChars.Lf & message
ReturnCType(XtraMessageBox.Show(lookAndFeel, control, myMessage, Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information), PortableDialogResult)
EndFunction' To test: enter incorrect data into a cell with a data validation rule applied.PublicFunction ShowDataValidationDialog(ByVal message AsString, ByVal title AsString, ByVal errorStyle As DataValidationErrorStyle) As PortableDialogResult Implements DevExpress.XtraSpreadsheet.Services.IMessageBoxService.ShowDataValidationDialog
Dim myMessage AsString = "Der eingegebene Wert ist ungültig." & ControlChars.Lf & ControlChars.Lf & message
Dim buttons As MessageBoxButtons
Dim icon As MessageBoxIcon
If errorStyle = DataValidationErrorStyle.StopThen
buttons = MessageBoxButtons.RetryCancel
icon = MessageBoxIcon.ErrorElseIf errorStyle = DataValidationErrorStyle.Warning Then
buttons = MessageBoxButtons.YesNoCancel
icon = MessageBoxIcon.Warning
Else
buttons = MessageBoxButtons.OKCancel
icon = MessageBoxIcon.Information
EndIfReturnCType(XtraMessageBox.Show(lookAndFeel, control, myMessage, title, buttons, icon), PortableDialogResult)
EndFunction' To test: click the Test button or try to set the row height to 1000.PublicFunction ShowMessage(ByVal message AsString, ByVal title AsString, ByVal icon As PortableMessageBoxIcon) As PortableDialogResult Implements DevExpress.XtraSpreadsheet.Services.IMessageBoxService.ShowMessage
Dim myMessage AsString = "Ein Fehler tritt auf." & ControlChars.Lf & ControlChars.Lf & message
Dim myIcon = CType(icon, MessageBoxIcon)
ReturnCType(XtraMessageBox.Show(lookAndFeel, control, myMessage, title, MessageBoxButtons.OK, myIcon), PortableDialogResult)
EndFunction' To test: drag and drop cells to another location trying to overwrite the content of the destination cells.PublicFunction ShowOkCancelMessage(ByVal message AsString) AsBooleanImplements DevExpress.XtraSpreadsheet.Services.IMessageBoxService.ShowOkCancelMessage
Dim myMessage AsString = "Möchten Sie diesen Vorgang wirklich ausführen?" & ControlChars.Lf & ControlChars.Lf & message
Return PortableDialogResult.OK = CType(XtraMessageBox.Show(lookAndFeel, control, myMessage, Application.ProductName, MessageBoxButtons.OKCancel, MessageBoxIcon.Information), PortableDialogResult)
EndFunction' To test: try to delete a defined name in the Name Manager dialog.PublicFunction ShowYesNoMessage(ByVal message AsString) AsBooleanImplements DevExpress.XtraSpreadsheet.Services.IMessageBoxService.ShowYesNoMessage
Dim myMessage AsString = "Entscheidung treffen. Ja oder Nein?" & ControlChars.Lf & ControlChars.Lf & message
Return PortableDialogResult.Yes = CType(XtraMessageBox.Show(lookAndFeel, control, myMessage, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question), PortableDialogResult)
EndFunctionEndClass