|
-
Sep 9th, 2008, 05:22 AM
#1
Thread Starter
Junior Member
Full Screen Picture
Hi.
I have a program that runs in a small window, (about a fifth of a full screen) which includes a button, among other objects.
When the button is clicked I want a full screen picture to be displayed, and when it is clicked again, the picture should close.
I have tried the Image and Picture controls, but they confine the picture to be within the small window.
I'm a novice, so this could be a simple question, but I have no idea where to go from here. Any help would be much appreciated.
Ted.
-
Sep 9th, 2008, 05:39 AM
#2
Re: Full Screen Picture
 Originally Posted by calpro
Hi.
I have a program that runs in a small window, (about a fifth of a full screen) which includes a button, among other objects.
When the button is clicked I want a full screen picture to be displayed, and when it is clicked again, the picture should close.
I have tried the Image and Picture controls, but they confine the picture to be within the small window.
I'm a novice, so this could be a simple question, but I have no idea where to go from here. Any help would be much appreciated.
Ted.
Hi, welcome to the forums.
I'm not sure if you're trying to magnify an already existing picture or just 'open' and 'close' a picture. In the latter case, you can do it in various ways.
One is using an invisible picturebox. When you click that button, make the picturebox visible and adjust its dimensions as necessary. When you click again you make it invisible. In order to acount for the appropriate action you can use a static variable:
Code:
Private Sub Command1_Click()
Static bVar As Boolean
'Initial value of bVar is False
If bVar = True Then
Picture1.Visible = False
Else
Picture1.Visible = True
'Use your values for the left, top, width and height properties
Picture1.Move xL, xT, xW, xH
'Plot something in the picturebox if not already there
'...
End If
bVar = Not bVar
End Sub
Another way to do this is plot on a blank (without controls) form that you can load and unload using code similar to the above.
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
-
Sep 9th, 2008, 11:54 PM
#3
Thread Starter
Junior Member
Re: Full Screen Picture
Hi krtxmrtz.Thanks for your reply, and sugestion. The end results were:
1. The picture was displayed, when the button was clicked.
2. The picture filled the small window, but it did not fill the screen. The picture was contained within the borders of the small form that I'm using.
What could you suggest I try?
Thanks again,
Ted.
-
Sep 10th, 2008, 04:28 AM
#4
Re: Full Screen Picture
 Originally Posted by calpro
Hi krtxmrtz.Thanks for your reply, and sugestion. The end results were:
1. The picture was displayed, when the button was clicked.
2. The picture filled the small window, but it did not fill the screen. The picture was contained within the borders of the small form that I'm using.
What could you suggest I try?
Thanks again,
Ted.
Then I would plot to a form. Add a borderless form (border style = None) to your project (e.g. Form2), and place a picturebox of any size (Pic1) on that form.
Place this code in the main form:
VB Code:
Private Sub Command1_Click()
Form2.Show 1 'Load and display the form and make it modal
End Sub
In Form2 you can place this code:
VB Code:
Private Sub Form_Load()
'Make your form as big as the whole screen
Me.Move 0, 0, 0.5*(Screen.Width - Width), 0.5*(Screen.Height - Height)
'Make your picturebox as large as the form (i.e. as the screen)
Pic1.Move 0, 0, Me.Width, Me.Height
'Here place the code to draw to the picture box
'...
'...
End Sub
'Now, to hide the picture and go back to the main form, click on the picture:
Private Sub Pic1_Click()
Me.Hide
End Sub
Let me know how this works, I haven't tried it myuself.
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
-
Sep 10th, 2008, 05:17 AM
#5
Thread Starter
Junior Member
Re: Full Screen Picture
Hi.
I've just a few minutes ago tried it with a form, and it worked perfectly.
Thanks, you've been a great help. I could have spent a lot of time on this without your help.
Ted
-
Sep 10th, 2008, 05:30 AM
#6
Re: Full Screen Picture
 Originally Posted by calpro
Hi.
I've just a few minutes ago tried it with a form, and it worked perfectly.
Thanks, you've been a great help. I could have spent a lot of time on this without your help.
Ted
You're welcome, (also to rate the post!) + Mark thread resolved.
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|