nav-left cat-right
cat-right

Check value of Radiobutton

Radiobuttons in MFC are a mess. It is nevertheless possible to get its values with the following instructions. If one wants to have a group of radiobuttons the most important principle is to add them one ofter the other so that they have a ascending Resource number without any interruption. The first one in the group of radiobuttons has have the value „group=true“. For this one we add an integer Variable, lets...

Set Radio Button at runtime

The following code sets the value of a radio button to checked: CButton *pButton = reinterpret_cast<CButton*>(GetDlgItem(IDC_RADIO1)); pButton->SetCheck(1); // Button is "checked" CButton *pButton = reinterpret_cast<CButton*>(GetDlgItem(IDC_RADIO1)); pButton->SetCheck(1); // Button is...

changing of the mouse cursor

The following code sets the mouse cursor to the waiting state and back to its default before: HCURSOR hCursorWait; HCURSOR hCursorDefault; hCursorWait = LoadCursor(NULL,IDC_WAIT); hCursorDefault = ::SetCursor(hCursorWait);   ::SetCursor(hCursorDefault); HCURSOR hCursorWait; HCURSOR hCursorDefault; hCursorWait = LoadCursor(NULL,IDC_WAIT); hCursorDefault = ::SetCursor(hCursorWait);...

Open, Save and Read Bitmaps

The task to read a bitmap into a data array, show this bitmap and save an array or dc to a file sound like a simple task but is rather difficult in reality if one uses MFC. Maybe I am totaly wrong when stating this, but that is my result of one week searching for solutions and implementing my own ones. What I have achieved can be as an example project.   bitmapopenandsave.zip (61,0 KiB) The idea of these classes is...

Show Dialog on Second Screen

The following Code maximises a dialog on the second screen. The code is available for download:   DrawOnSecondScreen.zip (43,9 KiB) void DlgSecondScreen::ResizeDialog(const CRect newRect) { // Resize Dialog SetWindowPos(&CWnd::wndTop, newRect.left, newRect.top, newRect.right, newRect.bottom, SWP_SHOWWINDOW | // Displays the window. SWP_NOCOPYBITS // Do NOT Save content ); }   void...

Flicker Free example with CStatic Control

The following code shows how to paint into a CStatic Control and make sure this painting is flicker-free. Overloading of CStaticCGraphCtrlFlicker Free drawingResizing of Images The example code for download:   FlickerFreeDemoStatic.zip (61,6 KiB) Overloading of CStatic Unfortunately one can not draw inside a CStatic control directly. Therefore one need to overload the CStatic class an do the following (let...
Seite 4 von 512345