全体 †Vista/Windows 7 環境で Windows Form アプリケーションの見た目が OS に合わせます。見た目を XP 風にするには。アプリケーション全体に下記のような設定する必要がある。 Application.EnableVisualStyles() カレンダー †カレンダー表示では、VBで設定したプロパティ値が引き継がれず、OSの設定が反映されてしまうようですので、設定を有効するするため、下記のような設定が必要。 Application.VisualStyleState = VisualStyleState.NoneEnabled だが、残念なことに、フォームのデザインがWin2000のような表示になってしまいました。 Win32 API †ComboBoxを例として、Win32 API でVista/Windows 7環境におけるXPのVisual Styleの利用する方法を紹介します。 using System; using System.Windows.Forms; using System.Runtime.InteropServices; class MyComboBox : ComboBox { protected override void OnHandleCreated(EventArgs e) { base.OnHandleCreated(e); SetWindowTheme(this.Handle, "", ""); } [DllImport("uxtheme.dll")] private static extern int SetWindowTheme(IntPtr hWnd, string appname, string idlist); } フレッツ光が月額556円~【GMOとくとくBB】 コメント: |