May 19, 2014, 8:37 PM
MessageBox button size issue when using custom captions
Hello,
When I show a MessageBox with custom text in the buttons and then another one with a short text (small buttons), the buttons remain at that size for all following instances of MessageBox and the captions appear incomplete. This is a demo:
Is this a bug? Is there a way to avoid this?
Thanks and regards,
Andrew
When I show a MessageBox with custom text in the buttons and then another one with a short text (small buttons), the buttons remain at that size for all following instances of MessageBox and the captions appear incomplete. This is a demo:
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
[DirectMethod]
public void Msg1(object sender, DirectEventArgs e)
{
ShowMessageBox("Yesss!", "Noooo!");
}
[DirectMethod]
public void Msg2(object sender, DirectEventArgs e)
{
ShowMessageBox("Y", "N");
}
private void ShowMessageBox(string yesTest, string noText)
{
MessageBoxConfig msgCfg = new MessageBoxConfig();
msgCfg.Title = "Button width test";
msgCfg.Message = "Are you sure?";
msgCfg.MessageBoxButtonsConfig = new MessageBoxButtonsConfig();
msgCfg.MessageBoxButtonsConfig.Yes = new MessageBoxButtonConfig();
msgCfg.MessageBoxButtonsConfig.Yes.Text = yesTest;
msgCfg.MessageBoxButtonsConfig.No = new MessageBoxButtonConfig();
msgCfg.MessageBoxButtonsConfig.No.Text = noText;
msgCfg.Buttons = MessageBox.Button.YESNO;
msgCfg.Icon = MessageBox.Icon.QUESTION;
msgCfg.Closable = false;
X.Msg.Show(msgCfg);
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>MessageBox buttons problem</title>
</head>
<body>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<h1>MessageBox buttons problem</h1>
<ext:Button runat="server" ID="Button1" Text="MessageBox 1">
<DirectEvents>
<Click OnEvent="Msg1" />
</DirectEvents>
</ext:Button>
<ext:Button runat="server" ID="Button2" Text="MessageBox 2">
<DirectEvents>
<Click OnEvent="Msg2" />
</DirectEvents>
</ext:Button>
</body>
</html>
Press MessageBox 1, buttons appear ok (large). Press MessageBox 2, buttons appear ok (small). Press MessageBox 1 again, and the buttons remain small and the text is cropped. This happens with versions 1.0 and 1.7.Is this a bug? Is there a way to avoid this?
Thanks and regards,
Andrew
Last edited by ALobpreis; May 19, 2014 at 8:39 PM.