//ChatListSubItem cm public CreateMeetingForm() { InitializeComponent(); ChatListItem cli = new ChatListItem("主持人"); height = this.Height; this.Height = this.cbxVote.Location.Y + 20; meetGrouplist.Location = new Point(meetGrouplist.Location.X, label1.Location.Y); btnAdd.Location = new Point(btnAdd.Location.X, this.Height - btnAdd.Height-5); MenuColorTable mct = new MenuColorTable(); ToolStripRendererEx t = new ToolStripRendererEx(mct); cmsiAdd.Renderer = t; ChatListSubItem clsl = new ChatListSubItem(SysParams.LoginUser.UID.ToString(), SysParams.LoginUser.Name, (SysParams.LoginUser.Company)); clsl.ID = SysParams.LoginUser.UID.ToString();//给初始化网络会议室的默认主持人ID复制 clsl.HeadImage = SysParams.loginUserImage != SysParams.defaultHead ? (Image)SysParams.loginUserImage.Clone() : SysParams.loginUserImage; cli.SubItems.Add(clsl); cli.IsOpen = true; meetGrouplist.ChatListBox_group.Items.Insert(0, cli); meetGrouplist.SkinContextMenuStrip_Group.Items.Clear(); meetGrouplist.SkinContextMenuStrip_Group.Items.Add("删除成员"); meetGrouplist.SkinContextMenuStrip_Group.Items[0].Click += CreateMeetingForm_Click; }
private void SetControlColorTable() { CaptureImageToolColorTable colorTable = ColorTable; ToolStripRendererEx renderer = new ToolStripRendererEx(colorTable); contextMenuStrip.Renderer = renderer; drawToolsControl.ColorTable = colorTable; colorSelector.ColorTable = colorTable; }
protected override void OnShown(EventArgs e) { base.OnShown(e); if (mp.GPUAPI == "vulkan") { mp.ProcessCommandLine(false); } var wpfColor = WPF.WPF.ThemeColor; Color color = Color.FromArgb(wpfColor.A, wpfColor.R, wpfColor.G, wpfColor.B); ToolStripRendererEx.InitColors(color, App.IsDarkMode, App.ThemedMenu); BuildMenu(); ContextMenuStrip = ContextMenu; WPF.WPF.Init(); System.Windows.Application.Current.ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown; Cursor.Position = new Point(Cursor.Position.X + 1, Cursor.Position.Y); WasShown = true; mp.LoadScripts(); Task.Run(() => App.Extension = new Extension()); }
protected override void OnHandleCreated(EventArgs e) { base.OnHandleCreated(e); Renderer = new ToolStripRendererEx(); }
public MainForm() { InitializeComponent(); try { Instance = this; Hwnd = Handle; mp.Init(); AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Application.ThreadException += Application_ThreadException; Msg.SupportURL = "https://github.com/stax76/mpv.net#support"; WPF.WPF.Init(); System.Windows.Application.Current.ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown; Text += " " + Application.ProductVersion; object recent = RegHelp.GetObject(App.RegPath, "Recent"); if (recent is string[] r) { RecentFiles = new List <string>(r); } else { RecentFiles = new List <string>(); } var wpfColor = WPF.WPF.ThemeColor; Color color = Color.FromArgb(wpfColor.A, wpfColor.R, wpfColor.G, wpfColor.B); ToolStripRendererEx.InitColors(color, App.IsDarkMode); ContextMenu = new ContextMenuStripEx(components); ContextMenu.Opened += ContextMenu_Opened; ContextMenu.Opening += ContextMenu_Opening; App.ProcessCommandLineEarly(); if (mp.Screen == -1) { mp.Screen = Array.IndexOf(Screen.AllScreens, Screen.PrimaryScreen); } int targetIndex = mp.Screen; Screen[] screens = Screen.AllScreens; if (targetIndex < 0) { targetIndex = 0; } if (targetIndex > screens.Length - 1) { targetIndex = screens.Length - 1; } Screen screen = screens[Array.IndexOf(screens, screens[targetIndex])]; Rectangle target = screen.Bounds; Left = target.X + (target.Width - Width) / 2; Top = target.Y + (target.Height - Height) / 2; int posX = RegHelp.GetInt(App.RegPath, "PosX"); int posY = RegHelp.GetInt(App.RegPath, "PosY"); if (posX != 0 && posY != 0 && App.RememberPosition) { Left = posX - Width / 2; Top = posY - Height / 2; } mp.Shutdown += Shutdown; mp.VideoSizeChanged += VideoSizeChanged; mp.FileLoaded += FileLoaded; mp.Idle += Idle; mp.VideoSizeAutoResetEvent.WaitOne(1500); if (Height < FontHeight * 4) { SetFormPosAndSize(); } mp.observe_property_bool("fullscreen", PropChangeFullscreen); mp.observe_property_bool("ontop", PropChangeOnTop); mp.observe_property_bool("border", PropChangeBorder); mp.observe_property_string("sid", PropChangeSid); mp.observe_property_string("aid", PropChangeAid); mp.observe_property_string("vid", PropChangeVid); mp.observe_property_int("edition", PropChangeEdition); } catch (Exception ex) { Msg.ShowException(ex); } }