Windows uses the extended style bits decide whether a window should have a taskbar icon, These styles aren't directly accessible in C#, but should be set correctly when your form is a normal application form.
The flag that controls this is the WS_EX_APPWINDOW
set in the extended styles of your top level form window. From the CreateWindowEx
documentation
WS_EX_APPWINDOW
Forces a top-level window onto the taskbar when the window is visible.
You can use Spy++ to see whether that flag is set for your window or not. The only way I know for sure to set it is to use interop.
[DllImport("user32.dll")]
static extern int SetWindowLong(IntPtr hWnd, int nIndex, IntPtr dwNewLong);
[DllImport("user32.dll", SetLastError = true)]
static extern int GetWindowLong(IntPtr hWnd, int nIndex);
const int GWL_EXSTYLE = -20;
const int WS_EX_APPWINDOW = 0x00040000;
int ExStyle = GetWindowLong(form.Handle, GWL_EXSTYLE);
SetWindowLong(form.Handle, GWL_EXSTYLE, new IntPtr(ExStyle | WS_EX_APPWINDOW));