Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. move a control on dialog box [modified]

move a control on dialog box [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
10 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yogendra kaushik
    wrote on last edited by
    #1

    plz help me plzzzzzzzzzzzzzzzzzzzz\ i dont understand by doing so the text movws its position once but does not contineously moves i want that it moves regularly plz send me code to help \\\\\\ i hav made a dialog based application now i want that onmy dialog i add "hello how r u" through Static control now i want that it moves on the screen all the time fron left to right like screen saver but i dont know how to do it plz tel me and send me code to solve my problem Please mail me -- modified at 3:16 Wednesday 21st June, 2006

    N _ H 3 Replies Last reply
    0
    • Y yogendra kaushik

      plz help me plzzzzzzzzzzzzzzzzzzzz\ i dont understand by doing so the text movws its position once but does not contineously moves i want that it moves regularly plz send me code to help \\\\\\ i hav made a dialog based application now i want that onmy dialog i add "hello how r u" through Static control now i want that it moves on the screen all the time fron left to right like screen saver but i dont know how to do it plz tel me and send me code to solve my problem Please mail me -- modified at 3:16 Wednesday 21st June, 2006

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      1.change the the id of static ctrl to some value say IDC_MOVING_TEXT 2.Set a timer using the SetTimer Function in the OnInitdialog function 3. In the on timer function call GetDlgItem( IDC_MOVING_TEXT )->SetWindowPos( 0, x, y, 0,0, SWP_NOSIZE|SWP_NOZORDER); decrement or increatement the x value to make the control move.... nave

      Y 2 Replies Last reply
      0
      • N Naveen

        1.change the the id of static ctrl to some value say IDC_MOVING_TEXT 2.Set a timer using the SetTimer Function in the OnInitdialog function 3. In the on timer function call GetDlgItem( IDC_MOVING_TEXT )->SetWindowPos( 0, x, y, 0,0, SWP_NOSIZE|SWP_NOZORDER); decrement or increatement the x value to make the control move.... nave

        Y Offline
        Y Offline
        yogendra kaushik
        wrote on last edited by
        #3

        Set a timer using the SetTimer Function in the OnInitdialog function wat how i define one function inside other as u tel me to set timer using settime function inside OnInitdialog function plz send me code for help Please mail me

        A 1 Reply Last reply
        0
        • Y yogendra kaushik

          Set a timer using the SetTimer Function in the OnInitdialog function wat how i define one function inside other as u tel me to set timer using settime function inside OnInitdialog function plz send me code for help Please mail me

          A Offline
          A Offline
          Anilkumar K V
          wrote on last edited by
          #4

          If u use MFC, add a handler for WM_TIMER and Call SetTimer to set interval if SDK and callback function for WM_TIMER Use SetTimer & KillTimer functions

          1 Reply Last reply
          0
          • Y yogendra kaushik

            plz help me plzzzzzzzzzzzzzzzzzzzz\ i dont understand by doing so the text movws its position once but does not contineously moves i want that it moves regularly plz send me code to help \\\\\\ i hav made a dialog based application now i want that onmy dialog i add "hello how r u" through Static control now i want that it moves on the screen all the time fron left to right like screen saver but i dont know how to do it plz tel me and send me code to solve my problem Please mail me -- modified at 3:16 Wednesday 21st June, 2006

            _ Offline
            _ Offline
            _AnsHUMAN_
            wrote on last edited by
            #5

            You can use MoveWindow() to set the coordinates of the static control Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_

            Y 1 Reply Last reply
            0
            • Y yogendra kaushik

              plz help me plzzzzzzzzzzzzzzzzzzzz\ i dont understand by doing so the text movws its position once but does not contineously moves i want that it moves regularly plz send me code to help \\\\\\ i hav made a dialog based application now i want that onmy dialog i add "hello how r u" through Static control now i want that it moves on the screen all the time fron left to right like screen saver but i dont know how to do it plz tel me and send me code to solve my problem Please mail me -- modified at 3:16 Wednesday 21st June, 2006

              H Offline
              H Offline
              Hamid Taebi
              wrote on last edited by
              #6

              yes use MoveWindow or SetWindowPos and if you need to timer in your program use SetTimer(500,1,NULL);(of course i suggest see MSDN for SetTimer) then declare WM_TIMER message void CAnswer::OnTimer(UINT nIDEvent) { } in the end use KillTimer(500); ---------------- for static control insert one static in form and change id and declare a variable for this control_**


              **_

              whitesky


              1 Reply Last reply
              0
              • _ _AnsHUMAN_

                You can use MoveWindow() to set the coordinates of the static control Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_

                Y Offline
                Y Offline
                yogendra kaushik
                wrote on last edited by
                #7

                plz can u tel me some example of theat how it works Please mail me

                _ 1 Reply Last reply
                0
                • Y yogendra kaushik

                  plz can u tel me some example of theat how it works Please mail me

                  _ Offline
                  _ Offline
                  _AnsHUMAN_
                  wrote on last edited by
                  #8

                  Suppose you have a dialog with a button on it. The dialog also has a static control with a variable associated as m_statictext. Now when you click the button the window changes its position. Say moves to (0,0) with some size. This is only a general example. You will have to create a timer and then keep on changing the position of the window as per your requirement.(Also check for bounds) //To test you can write this code on the click of the button and see the window changing its position m_statictext.MoveWindow(CRect(0,0,100,100),1); Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_

                  1 Reply Last reply
                  0
                  • N Naveen

                    1.change the the id of static ctrl to some value say IDC_MOVING_TEXT 2.Set a timer using the SetTimer Function in the OnInitdialog function 3. In the on timer function call GetDlgItem( IDC_MOVING_TEXT )->SetWindowPos( 0, x, y, 0,0, SWP_NOSIZE|SWP_NOZORDER); decrement or increatement the x value to make the control move.... nave

                    Y Offline
                    Y Offline
                    yogendra kaushik
                    wrote on last edited by
                    #9

                    plz can u send me code which help me as i do with this but it changes its position and i want to move text regularly plzzzzzzz Please mail me

                    H 1 Reply Last reply
                    0
                    • Y yogendra kaushik

                      plz can u send me code which help me as i do with this but it changes its position and i want to move text regularly plzzzzzzz Please mail me

                      H Offline
                      H Offline
                      Hamid Taebi
                      wrote on last edited by
                      #10

                      What do you need its not hard_**


                      **_

                      whitesky


                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups