15. februar 2000 - 08:45Der er
4 kommentarer og 2 løsninger
MVC++6 && bitmaps
Hvordan bestemmer man hvilken bitmap der er øverst, når man har flere på sin dialog, der overlapper (i et MFC(exe) - dialogbased projekt)? Hvordan sætter man det runtime?
Jeg har ikke MVC 6.0 selv, men i BCB bliver bitmaps tegnet i creation order - dvs. den der dannes først ligger "nederst", med mindre man gør et af to:
1) Laver "Bring to front" på en af de andre bitmaps 2) På designtidspunktet laver "Bring to front" på en af bit-mappene.
Windows SDK'en siger (uddrag): The order in which controls stack on top of each other (called the Z order) depends on the order the controls are placed on the form. For example, if you put a label and an image on a form so that one is on top of the other, the one that was placed first on the form becomes the one on the bottom. Because both the label and the image are non-windowed controls, they “stack” as you would expect them to. Call the BringToFront method for the bottom object to make it appear on top.
The stacking order of two windowed controls is the same as the stacking of two non-windowed controls. For example, if you put a memo on a form, then put a check box on top of it, the check box remains on top. Calling BringToFront for the memo moves the memo so that it appears on top.
The stacking order of windowed and non-windowed controls cannot be mingled. For example, if you put a memo (a windowed control) on a form, and then put a label (a non-windowed control) on top of it, the label disappears behind the memo. Windowed controls always stack on top of non-windowed controls. In this example, calling the BringToFront method of the label does nothing, the label remains behind the memo.
Du mapper de ønskede Picture bokse som CStatic kontroller i Wizarden under Member Variables!
Ved at kalde m_Bitmap1.BringWindowToTop(); lægges det pågældende bitmap øverst. Jeg kan ikke finde en måde hvorpå det kan checkes hvordan rækkefølgen er for de pågælende bitmaps. Du må bare kalde BringWindowOnTop() for dem alle i den rigtige rækkefølge! Det vil sige det bitmap, der skal ligge nederst skal selvfølgelig kaldes først. Invalidate(FALSE) skal kaldes før ændringen træder i kraft!
Præcis som jeg beskrev for BCB !!! (Man kan undre sig over at det hedder BringToFront i BCB, når Windows API'en nu en gang hedder BringWindowToTop ?!?)
Hvad med dettte spørgsmål??? Har du fået svar nok eller hva???
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.