Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Oct 20, 2008 06:28 PM by NC01
Member
38 Points
52 Posts
Oct 20, 2008 04:21 AM|LINK
Hi
I am with a new post.I am having some HTML files and i want to load onto a .NET webbrowser control loaded to a window form .But there i want to resize the window size as metioned in the JavaScript which is not happening for me at the moment.
My Html File :
<html> <head> <title>Test</title> <script language="JavaScript">
var dargs = load_resize(1050, 640);// resize the window window.moveTo(1,1);
function load_resize(w, h) {
if (!isNaN(w) && !isNaN(h)) { window.resizeTo(w,h); // here it resizes the window window.moveTo(1,1);
} return null; }
</script> </head> <body bgcolor='silver' style='overflow-x: hidden'> test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 </body> </html>
My C# code
{
}
The problem is the Window is not resizing as per the size metioned load_resize(1050, 640);.
1) I have made the form autosize property to true.
Am i missing something
__Das
All-Star
82577 Points
15430 Posts
MVP
Oct 20, 2008 06:28 PM|LINK
Put this statement var dargs = load_resize(1050, 640); just before the </body> tag.
NC...
das.dwipayan
Member
38 Points
52 Posts
Resize webbrowser control as per the loaded Page size.
Oct 20, 2008 04:21 AM|LINK
Hi
I am with a new post.I am having some HTML files and i want to load onto a .NET webbrowser control loaded to a window form .But there i want to resize the window size as metioned in the JavaScript which is not happening for me at the moment.
My Html File :
<html>
<head>
<title>Test</title>
<script language="JavaScript">
var dargs = load_resize(1050, 640);// resize the window
window.moveTo(1,1);
function load_resize(w, h)
{
if (!isNaN(w) && !isNaN(h))
{
window.resizeTo(w,h); // here it resizes the window
window.moveTo(1,1);
}
return null;
}
</script>
</head>
<body bgcolor='silver' style='overflow-x: hidden'>
test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890 test1234567890
</body>
</html>
My C# code
private void Form1_Load(object sender, EventArgs e){
try{
webBrowser1.Navigate(Application.StartupPath +"\\Web.htm");}
catch{
MessageBox.Show("URL Not found .");}
}
The problem is the Window is not resizing as per the size metioned load_resize(1050, 640);.
1) I have made the form autosize property to true.
Am i missing something
__Das
Dwipayan Das
Software engineer
NC01
All-Star
82577 Points
15430 Posts
MVP
Re: Resize webbrowser control as per the loaded Page size.
Oct 20, 2008 06:28 PM|LINK
Put this statement var dargs = load_resize(1050, 640); just before the </body> tag.
NC...