メインフォームを非表示でアプリケーションを立ち上げるには、SetVisibleCore を オーバーライドして、初回の引数を false にします。 Load イベントが起きなくなるので、HandleCreated イベントなどで代用するといいでしょう。
public partial class MainForm : Form
{
private bool firstTimeVisible = true;
public MainForm() {
using System; | |
using System.ComponentModel; | |
using System.Drawing; | |
using System.Reflection; | |
using System.Runtime.InteropServices; | |
using System.Windows.Forms; | |
public partial class Form1 : Form | |
{ | |
private NotifyIcon notifyIcon; |
メインフォームを非表示でアプリケーションを立ち上げるには、SetVisibleCore を オーバーライドして、初回の引数を false にします。 Load イベントが起きなくなるので、HandleCreated イベントなどで代用するといいでしょう。
public partial class MainForm : Form
{
private bool firstTimeVisible = true;
public MainForm() {
using System; | |
using System.Collections.Generic; | |
using System.Windows.Forms; | |
public class VBForm : Form | |
{ | |
private readonly List<Control> tabIndexList = new List<Control>(512); | |
public VBForm() { | |
ControlAdded += ControlAddedEvent; |
Option Strict On | |
Imports System.Runtime.InteropServices | |
Public Class CustomTabControl | |
Inherits TabControl | |
Public Sub New() | |
DoubleBuffered = True | |
ResizeRedraw = True | |
SetStyle(ControlStyles.UserPaint, False) |
Windows 8 から子ウインドウがレイヤードウインドウになれるので、アプリケーションマニュフェストを追加して
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
のコメントアウトを解除すると、簡単に透過できます。
Imports System.Runtime.InteropServices
ビットマップから Graphics.FromImage で Grapchis オブジェクトを作成し、TextRenderer で描画すると太く見えますが、 太く見えるのはハーフトーンで描画される部分が真っ黒に塗りつぶされているためだったみたいです。 ハーフトーンの品質を上げるとキレイに見えます。
こんなクラスを作って
Imports System.Drawing
Imports System.Drawing.Text
Imports System.Runtime.InteropServices
using System; | |
using System.Runtime.InteropServices; | |
using System.Windows.Forms; | |
public partial class Form1 : Form | |
{ | |
private int ncHeight; | |
private int ncWidth; | |
private int hitTest; | |
private double aspect = 0; |
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Diagnostics; | |
using System.Linq.Expressions; | |
using System.Reflection; | |
class OrderPoco | |
{ | |
public int OrderID { get; set; } |
namespace AutoSizeGridDemo | |
{ | |
using System; | |
using System.ComponentModel; | |
using System.Drawing; | |
using System.Drawing.Drawing2D; | |
using System.Reflection; | |
using System.Windows.Forms; | |
public partial class Form2 : Form |
Imports System.ComponentModel | |
Imports System.Runtime.InteropServices | |
''' <summary> | |
''' Class that install hook procedures using SetWindowsHookEx | |
''' </summary> | |
<DesignerCategory("Code")> | |
Public MustInherit Class WindowsHookInstaller | |
Inherits Component |