PDA

View Full Version : Movies and scales



soeursourire
05-07-2008, 03:22 AM
Hi!

I would like to use VBA for creating a kind of psychological interface. I would like to ask you if you think this would be feasible:
- I need to present movies in full screen (without the possibility for the subject to stop accelerate the film)
- Between each film I would need to ask the subject to select the emotion associated to the film choosing between 6 categories (or maybe using sliders)
- I also need to present images.

Do you think this is something feasible? (all in full screen) Do you have some advices, some example code?

Thanks in advance for your help

Bob Phillips
05-07-2008, 04:32 AM
Excel/VBA seems gross overkill for this to me. A pencil and paper would seem to do the job just great.

soeursourire
05-07-2008, 04:39 AM
Oki then if I forget about the rating of emotions and I just want to present some movies one after one but without the buttons to accelerate stop etc the video, is it possible?

I would also need to put empty screen with a cross drawn on it during a certain amount of time between each film is it possible?

Thanks

soeursourire
05-07-2008, 07:09 AM
And I also try to put some images in my application in full screen unfortunately my image become too small in fullscreen I loose the real size of my real image:

UserForm2.Image1.Picture = LoadPicture("G:\" & x & ".bmp")
UserForm2.Image1.PictureAlignment = fmPictureAlignmentCenter

How can I keep the original size of my picture or fitting it to screen?

Thanks

mdmackillop
05-07-2008, 09:04 AM
Use two screens?

soeursourire
05-07-2008, 11:55 PM
Nope only one

soeursourire
05-08-2008, 12:24 AM
I will show you the code I am using, please tell me if you see an error which causes my image to be not in fullscreen:

I have 2 userforms: the 1st one has a START commandButton and the second has an image:

'FIRST USERFORM
Sub CommandButton1_Click()

Unload UserForm1

'maximize the size of the window under the application.
Application.WindowState = xlMaximized
UserForm2.Width = Application.Width
UserForm2.Height = Application.Height
UserForm2.Show
UserForm2.UserForm2_Initialize
End Sub


'SECOND USERFORM
Sub UserForm2_Initialize()
UserForm2.Image1.Picture = LoadPicture("G:\Soso" & x & ".bmp")
UserForm2.Image1.PictureAlignment = fmPictureAlignmentCenter
Me.Repaint
End Sub

Private Sub Image1_Click()
UserForm3.UserForm3_Initialize
End Sub

Private Sub UserForm_Click()
End Sub

Any ideas?

Andy Pope
05-08-2008, 03:09 AM
The main reason is your UserForm2_Initialize routine is not run until the userform is unloaded. You can do either of the following

Call the method before displaying userform2.
Place the code in the forms Initialize event rather than your own routine.


Sub CommandButton1_Click()

Unload UserForm1

'maximize the size of the window under the application.
Application.WindowState = xlMaximized
UserForm2.Width = Application.Width
UserForm2.Height = Application.Height
UserForm2.UserForm2_Initialize

UserForm2.Show

End Sub



Also you need to resize the image control to match the new userform size.


Sub UserForm2_Initialize()
With UserForm2.Image1
.Move 0, 0, Me.InsideWidth, Me.InsideHeight
.Picture = LoadPicture("G:\Soso" & x & ".bmp")
.PictureAlignment = fmPictureAlignmentCenter
.PictureSizeMode = fmPictureSizeModeStretch
End With
Me.Repaint
End Sub

soeursourire
05-08-2008, 04:18 AM
Thanks a lot!