Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2046,7 +2046,7 @@ protected override void OnHandleCreated(EventArgs e)
protected override void WindowChromeStart()
{
// Make sure the views for the buttons are created
if (_recreateButtons)
if (_recreateButtons && this.ControlBox && !string.IsNullOrWhiteSpace(this.Text))
{
_buttonManager.RecreateButtons();
_recreateButtons = false;
Expand Down
96 changes: 81 additions & 15 deletions Source/Krypton Components/TestForm/Bug2914Test.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions Source/Krypton Components/TestForm/Bug2914Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,68 @@ public Bug2914Test()
{
InitializeComponent();
}

private void Bug2914Test_Load(object sender, EventArgs e)
{

}

// Event handler for kryptonButton1 click
// Opens the Bug2914Test form as a modal dialog with no title bar text
// and without the system control buttons (minimize, maximize, close).
private void kryptonButton1_Click(object sender, EventArgs e)
{
// Create a new instance of the Bug2914Test form
Bug2914Test frm = new Bug2914Test();

// Center the form on the screen when it is shown
frm.StartPosition = FormStartPosition.CenterScreen;

// Explicitly set the location (redundant when using CenterScreen,
// but kept for consistency or testing purposes)
frm.Location = new Point(0, 0);

// Remove the window title text
frm.Text = string.Empty;

// Allow the form to be resized
frm.FormBorderStyle = FormBorderStyle.Sizable;

// Disable the control box (Close, Minimize, Maximize buttons)
frm.ControlBox = false;

// Show the form as a modal dialog
frm.ShowDialog();
}

// Event handler for kryptonButton2 click
// Closes the current form.
private void kryptonButton2_Click(object sender, EventArgs e)
{
// Close the current window
this.Close();
}

// Event handler for kryptonButton3 click
// Opens the Bug2914Test form as a modal dialog with a visible title.
private void kryptonButton3_Click(object sender, EventArgs e)
{
// Create a new instance of the Bug2914Test form
Bug2914Test frm = new Bug2914Test();

// Center the form on the screen
frm.StartPosition = FormStartPosition.CenterScreen;

// Set the initial position of the form
frm.Location = new Point(0, 0);

// Set the window title text
frm.Text = "HOLA";

// Allow the form to be resized
frm.FormBorderStyle = FormBorderStyle.Sizable;

// Show the form as a modal dialog
frm.ShowDialog();
}
}
3 changes: 3 additions & 0 deletions Source/Krypton Components/TestForm/Bug2914Test.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="kryptonManager1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
Loading