473,471 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Control Scaling???

I have 2 controls on a page that need to be defined by absolute horiz. and
vert. sizes, and both need to be a percentage of the screen size. Does anyone
know of a easy way to grab the screen extents, divide them by fractions that
can then be assigned to the controls on initialization.

I am working in C# in ASP.Net!

--
D @ premierdata
Nov 19 '05 #1
3 1504
Hi Dewright,

Welcome to ASP.NET newsgroup.
As for the grabing the screen size of clientside in asp.net page, here are
some of my suggestions:

Since the screen size is the clientside information, currently we could
only retrieve it through clientside scripts. The problem is that clientside
scripts need to be executed at clientside (browser context), so we need to
at least let our page be render to client once to get those info. Since
you need to get the screen size so as to coordinate your serverside
control's size, I think we have the following means:

1. We retreive the clientside screen size in client script and also use
client script to modify our server control's size( through the attributes
of the controls' rendered html elements at client)

2. We use client script to get the screen size and post back to server
again and adjust the control's size in serverside code. This'll need an
additional roundtrip to clientside.

Here is a web link which provide the clientscripts on how to get the screen
size at clientside;

#Screen Size
http://www.javascripter.net/faq/screensi.htm

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Nov 19 '05 #2
Great stuff, you are always a great source of info. To go along with this
then is there a easy way to take these values from the Javascript and add
them to my session variables? I will pass them from page to page to scale the
individual controls appropriatley.

Thanks Steven!

"Steven Cheng[MSFT]" wrote:
Hi Dewright,

Welcome to ASP.NET newsgroup.
As for the grabing the screen size of clientside in asp.net page, here are
some of my suggestions:

Since the screen size is the clientside information, currently we could
only retrieve it through clientside scripts. The problem is that clientside
scripts need to be executed at clientside (browser context), so we need to
at least let our page be render to client once to get those info. Since
you need to get the screen size so as to coordinate your serverside
control's size, I think we have the following means:

1. We retreive the clientside screen size in client script and also use
client script to modify our server control's size( through the attributes
of the controls' rendered html elements at client)

2. We use client script to get the screen size and post back to server
again and adjust the control's size in serverside code. This'll need an
additional roundtrip to clientside.

Here is a web link which provide the clientscripts on how to get the screen
size at clientside;

#Screen Size
http://www.javascripter.net/faq/screensi.htm

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



Nov 19 '05 #3
Thanks for your sincere reply,

I'm very glad that my suggestion was of assistance. As for the further
question you mentioned, I think we can consider the following approach:

Since you said that you'll retrieve this information just at the first time
the user visited the application and then cache them in Session, I think we
can makeing a particular page which is used to collect such clientside
information. So when the user visit our web application, we can check the
session state( or maybe a flag in cookie) which indicate whether we've
cached the user's clientside info or not. If not, we store the current
requested page's address and then redirect to the particular page the
particular page collect the information through those client scripts
mentioned in former message and postback to store the collected info into
session. After that , the user is redirected to the originally requesting
page.

How do you think of this? Please feel free to let me know if you have any
other questions or ideas.

Thanks & Regards,

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)





Nov 19 '05 #4

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

Similar topics

0
by: Colin | last post by:
Hi, It seems vs.net does some automatic scaling in the ide. like if i take a project develloped under 96 dpi low res and load it under 120 dpi hi res it does all kinds of automatic resizing. this...
1
by: susie_richie_30 | last post by:
Hi, I am trying to apply gray scaling to color as well as black/white images. I have tried using the pixel by pixel approach to achieve the scaling. But the particular approach has a issue with...
0
by: Steven | last post by:
Hello, I have a problem in scaling printing. I use standard print dialog. When I click the button of "Property" in this dialog, it shows the printer's property dialog. As usual, there is a...
0
by: Steven | last post by:
Hello, I have a problem in scaling printing. I use standard print dialog. When I click the button of "Property" in this dialog, it shows the printer's property dialog. As usual, there is a...
1
by: DEWright_CA | last post by:
Hello Everyone! I am curious if anyone has done anything so automate the scaling of controls based on screen resolution. In my case I have a minimum screen res of 1024x768 for my page size,...
3
by: Larry Serflaten | last post by:
I am taking a 256 color bitmap from a file and scaling it up X 16 to a 32bppPARGB bitmap in memory. I copy that image to the screen. After scaling, the edges of all the lines and colors are...
2
by: MCM | last post by:
I'm working on a plotting control. The plotting control will have a context menu with basic commands for "scaling", "zooming", etc. Is there a way that, from the parent form, I can add more...
3
by: Joseph Gruber | last post by:
Hi all -- I have two questions. First, I'm adding a control to my form at runtime and the control/form seems to ignore the anchor property of the runtime control. Any idea how I can get a...
4
by: xDrDoSx | last post by:
does any one have good tutorials or articles on PHP and database scaling?
0
by: igalep132 | last post by:
Hey all, I was trying to resize control size to the form size. I'm changing my form size according to current Screen Size by using Screen.PrimaryScreen.WorkingArea; and then I'm making a...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.