soferstam
asked on
UserControl resize not working with scripting in IE
Hi All,
I have build ActiveX control which was working for years.
Now I decided to update it.I did not toch any sizing functionallity.After registering the new ocx,with comletely new ProgID,I'm able to change Height and Width from everywhere but NOT using scripting in IE.Same problem on different computers.This is the public method of my control I'm using to resize:
Public Sub Resize(HT, WD)
Print #1, "Resize(HT, WD),BEGIN"
Print #1, "Resize(HT, WD).Passed val:" & CStr(vLng(HT) * _
Screen.TwipsPerPixelY) & "," & CStr(vLng(WD) * Screen.TwipsPerPixelX)
UserControl.Height = vInt(HT) * Screen.TwipsPerPixelY
UserControl.Width = vLng(WD) * Screen.TwipsPerPixelX
Print #1, "Resize(HT, WD) control height=" & CStr(UserControl.Height)
Print #1, "Resize(HT, WD),END"
End Sub
Private Sub UserControl_Resize()
end sub
This is the log file:
Resize(HT, WD),BEGIN
Resize(HT, WD).Passed val:3000,14385
Resize(HT, WD) control height=15
Resize(HT, WD),END
As you can see from the log,UserControl got 3000,
was trying to assing:
UserControl.Height=3000,
But after this it is still 15...
Any ideas,please..
I have build ActiveX control which was working for years.
Now I decided to update it.I did not toch any sizing functionallity.After registering the new ocx,with comletely new ProgID,I'm able to change Height and Width from everywhere but NOT using scripting in IE.Same problem on different computers.This is the public method of my control I'm using to resize:
Public Sub Resize(HT, WD)
Print #1, "Resize(HT, WD),BEGIN"
Print #1, "Resize(HT, WD).Passed val:" & CStr(vLng(HT) * _
Screen.TwipsPerPixelY) & "," & CStr(vLng(WD) * Screen.TwipsPerPixelX)
UserControl.Height = vInt(HT) * Screen.TwipsPerPixelY
UserControl.Width = vLng(WD) * Screen.TwipsPerPixelX
Print #1, "Resize(HT, WD) control height=" & CStr(UserControl.Height)
Print #1, "Resize(HT, WD),END"
End Sub
Private Sub UserControl_Resize()
end sub
This is the log file:
Resize(HT, WD),BEGIN
Resize(HT, WD).Passed val:3000,14385
Resize(HT, WD) control height=15
Resize(HT, WD),END
As you can see from the log,UserControl got 3000,
was trying to assing:
UserControl.Height=3000,
But after this it is still 15...
Any ideas,please..
Could you paste the scripting part?
ASKER
From VB (Working):
Private Sub Form_Resize()
NavBar1.Resize (Me.Height - 1000) / Screen.TwipsPerPixelY, (Me.Width - 1000) / Screen.TwipsPerPixelX
End Sub
From Script(NOT Working):
function window_onresize() {
NavBar1.Resize(document.bo dy.offsetH eight,docu ment.body. offsetWidt h);
prevheight=document.body.o ffsetHeigh t;
}
....
<body onresize="window_onresize( )">
<OBJECT id=NavBar1 style="LEFT: 0px; WIDTH: 50px; TOP: 0px; HEIGHT: 250px" height=250
width=50 classid="clsid:52F8B7B5-E7 E5-433B-AB DE-385168E F41CE" VIEWASTEXT>
<PARAM NAME="_ExtentX" VALUE="1323">
<PARAM NAME="_ExtentY" VALUE="6615">
<PARAM NAME="Color" VALUE="14737632">
</OBJECT>
Private Sub Form_Resize()
NavBar1.Resize (Me.Height - 1000) / Screen.TwipsPerPixelY, (Me.Width - 1000) / Screen.TwipsPerPixelX
End Sub
From Script(NOT Working):
function window_onresize() {
NavBar1.Resize(document.bo
prevheight=document.body.o
}
....
<body onresize="window_onresize(
<OBJECT id=NavBar1 style="LEFT: 0px; WIDTH: 50px; TOP: 0px; HEIGHT: 250px" height=250
width=50 classid="clsid:52F8B7B5-E7
<PARAM NAME="_ExtentX" VALUE="1323">
<PARAM NAME="_ExtentY" VALUE="6615">
<PARAM NAME="Color" VALUE="14737632">
</OBJECT>
could i send you an example project?
Why do you want to delete this?
ASKER
Hi,
Actually I found a bug in my code:
I was trying to do this:
1)Usercontrol.height=...
2)UserControl.Width=...
3)sub UserControl_Resize ....
4)somethingelse=UserContro l.Width
5)end sub
So what happend is:
From line 1) execution going to Line 3),so my "somethingelse" still has the old size...
I resolved it by replasing lines 1) ans 2) with:
UserControl.Size x,y Method.
Thanks
Actually I found a bug in my code:
I was trying to do this:
1)Usercontrol.height=...
2)UserControl.Width=...
3)sub UserControl_Resize ....
4)somethingelse=UserContro
5)end sub
So what happend is:
From line 1) execution going to Line 3),so my "somethingelse" still has the old size...
I resolved it by replasing lines 1) ans 2) with:
UserControl.Size x,y Method.
Thanks
Then, ask to community support to PAQ this, don't delete it.
Cheers
Cheers
ASKER
I do not know how to "ask to community "
But I do NOT whant to delete this if someone needs it.
But I do NOT whant to delete this if someone needs it.
soferstam, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:
Refund points and save as a 0-pt PAQ.
DanRollins -- EE database cleanup volunteer
Moderator, my recommended disposition is:
Refund points and save as a 0-pt PAQ.
DanRollins -- EE database cleanup volunteer
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.