|
-
May 3rd, 2000, 01:59 PM
#1
Thread Starter
Hyperactive Member
Hi,
My app has an MDIForm which has a PictureBox and an Image control on the Picturebox. How do I load a childform over this MDIForm?? When I use
Load Childform
only the titlebar of my app changes, but the childform is not visible.
If I change the MDIChild property to false then the form is visible. But I need the form to be a childform.
Any ideas????
Thanx in advance.
-
May 3rd, 2000, 04:10 PM
#2
transcendental analytic
This surely is weird because it works on my computer. Maybe you just have some problems with the form properties:
1. Is it visible?
2. Is it in the correct position? HAve you anything that moves your childform before it loads or in its load event.
You can post some of you code if the problems persist and i'll have a look at it.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 4th, 2000, 12:09 AM
#3
Thread Starter
Hyperactive Member
kedaman...........
Hi kedaman,
This is the code I've used:
In the MDIForm Load event:
--------------------------
Image1.Picture = LoadPicture("C:\windows\setup.bmp")
Set Env = rdoEngine.rdoEnvironments(0)
Set cn = Env.OpenConnection("User", rdDriverNoPrompt, ,"ODBC;Database=User;UID=admin;PWD=password;DSN=User")
FrmLogin.Show
In FrmLogin's load event:
-------------------------
Dim Ret1 As Long
Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2
Set Users = cn.OpenResultset("select * from user order by userid", rdOpenDynamic)
LblQues.Caption = Question_Gen
If ReLogin Then
'To disable Ctrl+Alt+Del
Ret1 = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, plod, 0)
End If
Users --> resultset
ReLogin --> Boolean variable
Question_Gen --> Is a function to randomly generate(?) a caption for the label control.
-----------------------------------------------------------
Any ideas???
Thanx again.
-
May 4th, 2000, 12:17 AM
#4
transcendental analytic
Well i think that wont tell me much, if you don't post the event where you're loading the mdichild
And also, how on earth are you suppose to load and image in the mdiform?!??
I don't think any controls can be placed on the mdiform, maybe you're mixing it up with the child.
But hey, don't start crying now, im sure I can fix this, if you only give me your whole project to look at.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 4th, 2000, 12:25 AM
#5
Do you mean you have placed a picturebox on the mdi parent form? If this picturebox is large, there won't be much workspace left for other forms. And if it covers the entire workspace, this would explain why you don't see the childforms. If you just want to put a background picture at the parents workspace, use the picture property.
-
May 4th, 2000, 01:00 AM
#6
transcendental analytic
Ah, i see. I didn't know about this placing pictures on a mdiform. Sorry about that. I think Frans C got the solution
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 4th, 2000, 01:22 AM
#7
Thread Starter
Hyperactive Member
Frans C.....
yup, Frans C. I've placed a picturebox and then an image control on the picture box. The reason I've done that and not used the picture property of the MDIFrom itself, is that the MDIForm does not have a Stretch property, which an image control does. (The picture box doesn't have that property as well). Is there any other way out??? Other than not making the form a child form(which I have to do!!!)???? Coz the form which has to be a child form is a registration form for the user and I need it to be a child form. Any ideas????
Thanks again!
-
May 4th, 2000, 02:05 AM
#8
transcendental analytic
I have a solution for that,
1. make the picturebox invisible, and remove the image
2. load the picture into the picturebox on the mdi instead.
3. use paintpicture method to stetch it to the size of the mdiform (you should resize the picturebox too)
4. set the mdiforms picture property to the picturebox
If you're not familiar with paintpicture, the vb help should explain well
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 4th, 2000, 11:39 AM
#9
Thread Starter
Hyperactive Member
kedaman........
All that u said works fine....well, almost.....Im unable to resize the picturebox.....what I did was try to set the width and height properties in the Load event of the mdiform....but that didnt quite work.
My code:
MDIForm1.WindowState = vbMaximized
Set Picture1.Picture = LoadPicture("D:\wannabrowse\bground.jpg")
Picture1.PaintPicture Picture1.Picture, 0, 0, MDIForm1.Width, MDIForm1.Height
Picture1.Width = MDIForm1.Width
Picture1.Height = MDIForm1.Height
MDIForm1.Picture = Picture1.Picture
Form1.Show
Ive set the mdichild property of form1 to true.
The only problem is that the picture size is not set to the mdiform size. How do I resize the picturebox???
Thanks.
-
May 4th, 2000, 12:05 PM
#10
Addicted Member
put that code in the form_resize event.
-
May 5th, 2000, 05:41 PM
#11
Thread Starter
Hyperactive Member
Raydr..........and anyone else whos' got an idea.....
Raydr,
I tries putting the code in the resize event of the MDIform, but it still doesn't work. The child form loads, but the picture on the main form doesnn't cover the entire form.
My code:
Private Sub MDIForm_Resize()
Picture1.Picture = LoadPicture("C:\windows\setup.bmp")
Picture1.PaintPicture Picture1.Picture, 0, 0, Screen.Width, Screen.Height
MDIForm1.Picture = Picture1.Picture
Picture1.Height = MDIForm1.Height
Form1.Show
End Sub
Any idea on how I can get this to work???
Thanks again.
-
May 5th, 2000, 06:43 PM
#12
transcendental analytic
Ok, Rammy, you need to put that picturebox into another form, and then do the resizing and paintpicturing there, and after that import it to your mdiparent. And also you should set the picturebox picture property to nothing after that.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
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
|