This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
/
MainForm.cs
56 lines (46 loc) · 1.5 KB
/
MainForm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraBars;
using DevExpress.XtraBars.Ribbon;
using System.Reflection;
using System.Drawing;
using DevExpress.XtraBars.ViewInfo;
using DevExpress.XtraBars.Controls;
using DevExpress.XtraBars.Forms;
namespace RibbonApplicationMenuBottomPaneFlicker
{
public partial class MainForm : RibbonForm
{
public MainForm()
{
InitializeComponent();
}
private void exitButton_ItemClick(object sender, ItemClickEventArgs e)
{
Close();
}
private void simpleButton1_Click(object sender, System.EventArgs e)
{
Close();
}
private void simpleButton1_Click_1(object sender, System.EventArgs e)
{
}
bool internalCalculating = false;
private void applicationMenu_BeforePopup(object sender, System.ComponentModel.CancelEventArgs e)
{
if (internalCalculating)
return;
internalCalculating = true;
try
{
MethodInfo mi = typeof(ApplicationMenu).GetMethod("CreateSubControl", BindingFlags.NonPublic | BindingFlags.Instance);
IFormContainedControl pc = mi.Invoke(applicationMenu, new object[] { Ribbon.Manager }) as IFormContainedControl;
bottomPaneControlContainer.Width = pc.CalcSize(-1, -1).Width;
}
finally {
internalCalculating = false;
}
}
}
}