I am converting an app I wrote when learning VB (I primarily use C++). In VB it was trivial to minimize a window to the Taskbar:

Private Sub GoButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GoButton.Click
    Me.WindowState = FormWindowState.Minimized

Setting the window state in the "Go" button's _Click method worked fine. Now I have:

private: void StartTimer() {
    this->Hide();

(the "Go" button is not the only way I trigger the action now) where "this" is the Form. This causes the window to "go away" (I suspect it is placed at screen location ~-32000x~-32000). I have tried:

private: void StartTimer() {
    //this->Hide();
    this->Minimize();

but it fails to compile:
Error 1 error C2039: 'Minimize' : is not a member of 'VisualTimer::Form1'

Any thoughts?

Recommended Answers

All 2 Replies

Here is C# way to do it, which is almost identical to CLR/C++ (which you are writing).

That looks like it minimizes to the Tray, not the Taskbar and uses Hide() which I have already tried. The reason I want to use the Taskbar is that I can change the label and use it as a visible countdown timer.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.