PDA

Click to See Complete Forum and Search --> : SetParent


pvbangera
Nov 26th, 2001, 04:49 AM
i have got a mdi form, on which i have a status bar and a progress bar. while doing any process i want to show the progress bar in one of the panels of the status bar.

i used the setparent method, but the prgress bar is not fitting into the panel of the status bar.

pls guid me.

regards,
prakash

pvbangera
Nov 26th, 2001, 08:07 AM
there's no one to answer this question?? :confused: :confused:

AlbafaN
Nov 26th, 2001, 10:13 PM
SetParent wont do that... setparent is for making a window a child of your MDI form...

darrenl
Nov 29th, 2001, 11:04 AM
There is no autosize, you have to do it yourself.

I use a common procedure like this

Sub SetupProgress(Parenthwnd As Long, Top As Long, height As Long, Left As Long, width As Long)

On Error Resume Next
OldProgress = SetParent(fMainForm.ProgressBar1.hwnd, Parenthwnd)

fMainForm.ProgressBar1.height = height
fMainForm.ProgressBar1.Left = Left
fMainForm.ProgressBar1.Top = Top
fMainForm.ProgressBar1.width = width
fMainForm.ProgressBar1.Visible = True

End Sub

and when I want to set up my progress bar onto a panel on my MDI form, in this example panel 3.

SetupProgress fMainForm.StatusBar1.hwnd, 0, fMainForm.StatusBar1.height, fMainForm.StatusBar1.Panels(3).Left, fMainForm.StatusBar1.Panels(3).width