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. How to size and move a view when it is created

How to size and move a view when it is created

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
2 Posts 2 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.
  • R Offline
    R Offline
    rbc
    wrote on last edited by
    #1

    Hi, I want my MyView to appear at x,y = 1,20 and be 1280 pixels wide and 800 high when it initially appears. I believe this is the code to move and size it ... CFrameWnd* pParentFrame = GetParentFrame(); ASSERT_VALID( pParentFrame ); pParentFrame->MoveWindow( 1, 20, 1280, 800 ); ... but what method should I put this code in? If I put in MyView::OnDraw everytime the View needs to be re-drawn it moves and resizes. I just want it start and 1,20 initially.

    M 1 Reply Last reply
    0
    • R rbc

      Hi, I want my MyView to appear at x,y = 1,20 and be 1280 pixels wide and 800 high when it initially appears. I believe this is the code to move and size it ... CFrameWnd* pParentFrame = GetParentFrame(); ASSERT_VALID( pParentFrame ); pParentFrame->MoveWindow( 1, 20, 1280, 800 ); ... but what method should I put this code in? If I put in MyView::OnDraw everytime the View needs to be re-drawn it moves and resizes. I just want it start and 1,20 initially.

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      You can set the initial size/position in PreCreateWindow(). --Mike-- When 900 years old you reach, look as good you will not. Hmm. 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

      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