Moving a button. 
Author Message
 Moving a button.

I am very new at VC++ I am writing my first MFC app. One part of the
program needs a button to be moved on a dialog rescource, but I dont
know how to do it. The dialog is called FINALDIALOG, and the button is
IDOK.
The only thing I can think of is to use the DRAWITEM. But do I need to?
How do I if so. Any help or example will be halpful.

THANKS!!

--
  |cemann


 homepage: http://www.*-*-*.com/

 Those people who tell you not to take chances, they are all missing out
on what life's about, you only live once so take hold of the chance,
don't end up like others the same song and dance. ---James Hetfield



Tue, 15 Aug 2000 03:00:00 GMT  
 Moving a button.

CWnd* pWnd = GetDlgItem(IDOK);
pWnd->MoveWindow( .. where ever .. );

--
Douglas Peterson
Software Engineer
Telex Communications, Inc
(For E-mail reply, remove the *'s)

Quote:

>I am very new at VC++ I am writing my first MFC app. One part of the
>program needs a button to be moved on a dialog rescource, but I dont
>know how to do it. The dialog is called FINALDIALOG, and the button is
>IDOK.
>The only thing I can think of is to use the DRAWITEM. But do I need to?
>How do I if so. Any help or example will be halpful.

>THANKS!!

>--
>  |cemann


> homepage: http://www.geocities.com/SunsetStrip/Palms/1598

> Those people who tell you not to take chances, they are all missing out
>on what life's about, you only live once so take hold of the chance,
>don't end up like others the same song and dance. ---James Hetfield



Tue, 15 Aug 2000 03:00:00 GMT  
 Moving a button.

Quote:
> I am very new at VC++ I am writing my first MFC app. One part of the
> program needs a button to be moved on a dialog rescource, but I dont
> know how to do it. The dialog is called FINALDIALOG, and the button is
> IDOK.
> The only thing I can think of is to use the DRAWITEM. But do I need to?
> How do I if so. Any help or example will be halpful.

> THANKS!!

> --
>   |cemann

You can move any window with SetWindowPos.

In your case:
GetDlgItem(IDOK)->SetWindowPos(NULL,x,y,0,0,SWP_NOZORDER|SWP_NOSIZE);

But don't move him where I can't see him!
cU
--

                        http://djuga.home.ml.org
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Retriever 1.0 is out:   http://retriever.home.ml.org

Shareware image viewer, thumbnailer & database
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Wed, 16 Aug 2000 03:00:00 GMT  
 Moving a button.

You can move any window using either the SetWindowPos() or MoveWindow()
functions.  I think MoveWindow() is easier, but both work.

Tom

Quote:

> I am very new at VC++ I am writing my first MFC app. One part of the
> program needs a button to be moved on a dialog rescource, but I dont
> know how to do it. The dialog is called FINALDIALOG, and the button is
> IDOK.
> The only thing I can think of is to use the DRAWITEM. But do I need to?
> How do I if so. Any help or example will be halpful.

> THANKS!!

> --
>   |cemann


>  homepage: http://www.geocities.com/SunsetStrip/Palms/1598

>  Those people who tell you not to take chances, they are all missing out
> on what life's about, you only live once so take hold of the chance,
> don't end up like others the same song and dance. ---James Hetfield



Fri, 18 Aug 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. WTL move a button with scroll bar

2. Move, resize button in CPropertySheet

3. Move a button in the CView

4. moving a button without flickering.

5. Trying to move a Button

6. Trying to move a Button

7. Move a button runtime

8. Moving a button.

9. Moving a Button and resizing a List Box HELP !!!!!

10. redrawing while mouse button is moving

11. CFileDialog move Buttons and Combobox

12. Toolbar button shows up after toolbar is moved????

 

 
Powered by phpBB® Forum Software