473,657 Members | 2,587 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

handle resize event

hey all,
is there a way to handle the event of resizing the browser window? If so,
what attribute/property will give me the width of the browser?

thanks for any help,
rodchar
Nov 1 '06 #1
4 10519
It's a client-side task. To set javascript event do

window.onresize =resized;

where resized is a javascript function.

Look here
http://msdn.microsoft.com/library/de.../measuring.asp
for understanding measuring element dimension and location.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"rodchar" <ro*****@discus sions.microsoft .comwrote in message
news:5C******** *************** ***********@mic rosoft.com...
hey all,
is there a way to handle the event of resizing the browser window? If so,
what attribute/property will give me the width of the browser?

thanks for any help,
rodchar

Nov 1 '06 #2
You have onresize client-side event for this purpose:

<body onresize="resiz eEventHandler() ;">
<body>

"rodchar" <ro*****@discus sions.microsoft .comwrote in message
news:5C******** *************** ***********@mic rosoft.com...
hey all,
is there a way to handle the event of resizing the browser window? If so,
what attribute/property will give me the width of the browser?

thanks for any help,
rodchar

Nov 1 '06 #3
how do i get the width of my browser. i see examples like window.innerWid th
but that's not working for me. am i doing something wrong?

"Siva M" wrote:
You have onresize client-side event for this purpose:

<body onresize="resiz eEventHandler() ;">
<body>

"rodchar" <ro*****@discus sions.microsoft .comwrote in message
news:5C******** *************** ***********@mic rosoft.com...
hey all,
is there a way to handle the event of resizing the browser window? If so,
what attribute/property will give me the width of the browser?

thanks for any help,
rodchar

Nov 1 '06 #4
If you are using IE:

document.body.s crollWidth
document.body.s crollHeight

"rodchar" <ro*****@discus sions.microsoft .comwrote in message
news:D1******** *************** ***********@mic rosoft.com...
how do i get the width of my browser. i see examples like window.innerWid th
but that's not working for me. am i doing something wrong?

"Siva M" wrote:
You have onresize client-side event for this purpose:

<body onresize="resiz eEventHandler() ;">
<body>

"rodchar" <ro*****@discus sions.microsoft .comwrote in message
news:5C******** *************** ***********@mic rosoft.com...
hey all,
is there a way to handle the event of resizing the browser window? If so,
what attribute/property will give me the width of the browser?

thanks for any help,
rodchar

Nov 3 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
7861
by: R.Wieser | last post by:
Hello All, I'm trying to get a "Virtual Listbox" to work. I've currently got a form, and used CreateWindowExA to create a ListBox with the LBS_OWNERDRAWFIXED and LBS_NODATA flags on it. I've allso subclassed the window and do see all kinds of WS_??? messages coming by. But now I'm stuck :-\ I've got *no* idea what to do next, and all my searching on the web leads me
1
1727
by: jeffg | last post by:
I have a DIV that needs to give the user the ability to grab its right border to resize the width of the block. I know that CSS supports properties such as cursor : col-resize to provide the visual indication that the element can be dragged with the mouse. But I cannot for the life of me figure out how to make the event fire only when the pointer is over the right border. I've searched this group many times and can't find anything on...
0
1301
by: Dave Veeneman | last post by:
I'm creating a custom control that uses the OnPaint event to paint a graphic. The graphic needs to resize itself when the control is resized. Right now, I'm trapping the Resize event to trigger the paint. However, the Resize event appears to fire repeatedly as the control is being resized, which causes the control to repaint repeatedly, chewing up CPU capacity. I'd like to have the control redraw only when the resize is complete, not...
0
1306
by: Bisbal | last post by:
Hi All, I have created a class that simulates a MDI form by putting the 'child' inside a panel located in the 'parent' form. I had to do this because we use a custom UI that doesn't work properly with standard MDI forms. The constructor of the class is something like SemiMDI(System.Windows.Forms.Form client,System.Windows.Forms.Panel parentArea)
3
3260
by: Z D | last post by:
Hello, BACKGROUND: ============== I've created a Windows User Control that contains an Image Control (among other controls). The user control handles the picture resize event. Whenever the parent that holds my user control is resized, I resize my image so that it uses the maximum available space. Note: It takes about 2 seconds to regenerate the
1
3127
by: Diogo Alves - Software Developer | last post by:
Hi there, Since my last questions wasn't very clear, I will do it in a different way. I want to resize my app but while resizing I dont want to see content of the form, I just want to see the window border, then on release, the form reappears, just like when we use "Show window contents while dragging" on the windowsXP appearance settings... Any Ideas in how to do it?
4
3480
by: Rob Richardson | last post by:
Greetings! I have a form with a listview, a menu, and a few text boxes, labels and command buttons. I want to resize the listview when the form is resized to that the widths of the spaces between the borders of the listview and the borders of the form remain constant. I am finding this to be unexpectedly hard. For one thing, I initialized some values in the form's Load event, and I'm doing the control resizing in the form's Resize...
0
1850
by: Patrick Lioi | last post by:
We have form that is used as the base class of all of our forms, let's call it BaseApplicationForm. We have another form, say ChildApplicationForm that inherits from BaseApplicationForm. The child form implements an event handler for the Resize event. Inside BaseApplicationForm.InitializeComponent, this.ClientSize is set to a value. On most of our developers' machines, this.ClientSize = ....; does NOT fire the Resize event, which makes...
11
3468
by: Ajith Menon | last post by:
I have created a windows application in which the form needs to be resized on the MouseMove event. The windows resize function takes a lot of CPU cycles. And as the resize function is called on the MouseMove, the form is resized around a 30-100 times in one second. This leads to a high CPU utilization and all other application comes to a stand still. The form does not have any controls i.e. buttons, text boxes etc. It is completely...
0
8394
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8306
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8825
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7327
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4152
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.