Avatar billede martens Guru
07. marts 2017 - 23:52 Der er 11 kommentarer og
1 løsning

sætte boks i bunden af en formular og den skal vokse opad...ikke nedad - via VBA

Er lige i test-mode, hvor jeg prøver at lave lidt grafer på en formular.

Jeg har en boks der som standard er 1 x 1 cm

denne boks højdeværdi hentes via vba fra en tabel, højden selvfølgelig varierer fra post til post,- Det virker også fint med højden, men jeg vil gerne have boksen til at stå nederst og vokse opad ... som det er nu vokser den nedad...

any clues or hints ?

mvh martens
Avatar billede terry Ekspert
08. marts 2017 - 14:38 #1
any chance of seeing some code so we can see what your trying to do. or maybe even an example dB ;-)
Avatar billede terry Ekspert
08. marts 2017 - 15:30 #2
just had a quick play around ....

If your box is in the form Footer and you want to place the bottom of your box so it is at the bottom of the footer then something like this might work.

NewHeight    is obviously the value your getting from the dB which I am guessing is in twips. (567 twips per centimetre)

      txtBox.Top = Me.FormFooter.Height - NewHeight   
      txtBox.Height = NewHeight
Avatar billede terry Ekspert
08. marts 2017 - 15:31 #3
you may need to do some error checking if you want to keep footer dimensions.
Avatar billede martens Guru
08. marts 2017 - 15:32 #4
Hej Terry..

Der er mail i din indbakke ;o)
Avatar billede terry Ekspert
08. marts 2017 - 15:39 #5
Received. I cant see any code where you try resizing pct_test_boks which I assume is the box in question?
Even so, I think you need to take the forms height into account as I do in the example, so you can calculate top.
Avatar billede martens Guru
08. marts 2017 - 15:42 #6
pct_test_boksen skal blot skifte baggrundsfarve ikke resizes ...
Avatar billede terry Ekspert
08. marts 2017 - 15:44 #7
OK, I see its Soejle_1_Vertikal and 2 which you are having problems with. Same applies here, calculate top from height of formdetail and subtract new height
Avatar billede terry Ekspert
08. marts 2017 - 15:48 #8
If you dont want to place boxes at bottom of form then you need to have a start point where bottom of boxes is to be placed so the top can be calculated from that
Avatar billede terry Ekspert
08. marts 2017 - 15:49 #9
hope you get the idea ;-)
Avatar billede terry Ekspert
08. marts 2017 - 15:58 #10
there is a method for moving form which saves a line of code

https://msdn.microsoft.com/en-us/library/office/ff193822.aspx
Avatar billede martens Guru
08. marts 2017 - 21:33 #11
Se beta 2 af projektet her :
https://1drv.ms/u/s!Aog7vvlTrHB6i9c13u1lLAx9dj0jTA

stor tak til Terry for super input !

mvh martens
Avatar billede terry Ekspert
09. marts 2017 - 11:50 #12
Looks good ;-)
And thanks
Avatar billede Ny bruger Nybegynder

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.

Loading billede Opret Preview

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester