.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

How make Controls scalable when resizing Window?

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :Windows Application

How do I make my Controls scalable in relation to the size of the Form?

I mean, when the Anchors of a Panel on a Form are set to all 4 borders then the Panel Width/Height properties change when changing the Form size but the Left/Top position of the Panel is fixed and not changing. What properties do I have to set to what value to also make the Panel's Left/Top position move when the undelying Form size is changed?



View Complete Post

More Related Resource Links

lossing focus from model pop up window controls


hi i using a model pop up window with some textbox but when i click on textbox of model pop up focus move to back to page textbox control plz help me 

Problem displaying a page using window.showModalDialog when resizing it.

 Hi, I have a page that is displayed using window.showModalDialog, when the page is resized the tables, text boxes and everything else that is in the page with the width 100% doesn't resize (fit the page) unless a post back is used.How can I make the page keep everything in proportion when it is resized without the need to post back? 

i make a web site using frame . A.Text box is in parent window . but i want when frame is load(fram

i make a web site using frame . A.Text box is in  parent window . but i want when frame is load(frame window Coding ) then parent window text is changed l(1)suppose parent window Text. is a when child widow is load thenparent window Text. is b

Change a controls properties from another window

I have a WPF App that opens a window (MainWindow) and has a button control that creates a new instance of a Window2 class and calls window2.show() When I click this button I disable it from within MainWindow code. The question I have is when the Window2 onclosing event is called  how do I access the Mainwindow button properties to enable it again. TIA Mike

Window Functions (OVER Clause) - Help Make a Difference

Hi all, Need your help with what I believe will benefit all of us SQL Server developers in the future--more complete support for the standard window functions in SQL Server. I tried to post the entire article text here, but apparently entries in this forum are limited to 60,000 characters. So here's a link to the article (no subscription required): Window Functions (OVER Clause) – Help Make a Difference. Cheers, BG-- BG

make Gridview data as hyper link with alias open in new window



I have one asp.net C# page in which i have gridview..

This are the url comes from database and binded in gridview




what i need is i need to show this url has like this

www.xxxxxx.com/A/Default.aspx is like Test1

www.xxxxxx.com/B/Default.aspx is like Test2

www.zzzzz.com/C/Default.aspx is like Test3

if user click Test1 it will open a new browser window with www.xxxxxx.com/A/Default.aspx

if user click Test3 it will open a new browser window with www.zzzzz.com/C/Default.aspx 

how to make this in gridview please help me in this...

How to make a wpf child window follow it's parent




I've been trying to make a child window follow it's parent, I've bound the child's Top and Left properties to it's parent and that works for resizing of the parent and when the parent is dragged around the screen.  However I've hit a problem when I maximize and minimize the parent the child doesn't match it's size. I've watched the values of the parents Top and left in the debugger and it seems to get set twice once with a value that matches the new size and again with it's previous value and I guess this is whats making the child window appear incorrectly. I'm starting to think that just binding to the parents Top and Left properties isn't going to work. Is there a better approach to achieve this?



Resizing Panel when adding controls


I have a panel on a form and I am adding controls to it from code behind.

Code behind:
First I am creating TableLayoutPanel
in loop I am adding controls to TableLayoutPanel
and then adding TableLayoutPanel to panel.

problem is I have specified panel height = 100 in designer. how to make it grow when more rows (controls) added to TableLayoutPanel?

At the same time I want to move controls below the Panel to move down..

| Panel		  |  --> I want to make this auto size
| Other Control1  |
| Other Control2  |
| Other Control3  |
| Other Control3  |

I tried setting Autosize=true for Panel and it didn't help!!

How to make window based site accessible from outside



We are using MOSS 2007. We have created window based site and extended it to use SQL-Form based Authentication so that users can access it from outside. Now we have a requirement to use the Active Directory Authentication and test the application from outside. Our Alternate Access Mapping settings are as below:

Internal URL                                  Zone                                         Public URL for Zone

http://server01                             Default                                        http://server01 

http://server01:12345                 &n

Make validation controls trigger only not clicking on submit button and not on other navigational bu


I have required validation controls on a page.  If the user got to this page by mistake and wants to go to a different section of the website using the navigational buttons; required validators are triggered and it will not let the user navigate away.  How do I get validators to trigger only when a submit button is clicked?


Thanks in advance!

Making your own controls - how to make them powerfully modifiable so anyone can use a control templa


If I look at a template for an expander, it always has to have a ContentPresenter in its control template and the control knows to use that for the content shown when the expander is expanded.  From there you can template out the control in all sorts of cool ways. 

A textbox's control templates need a scrollviewer with x:Name=PART_ContentHost for example.

The expander is fine with an unnamed control template, but the textbox requires a named scrollviewer.  I haven't messed around with putting multiple content presenters in an expander's control template and I currently have no idea what that would do.  This aspect of building my own controls is still quite foggy to me.  If I were to build a control, how do I determine if it looks for a named element in the control template (ala the textbox) or if it just finds a content presenter etc?

What if I wanted my new control to always contain several elements?

For example, with my current set of questions I am working on a resizable element.  I want that to always contain a draggable left and right boundary, as well as a togglable UI element for each of those boundaries that will toggle certain behaviors when I drag a specifc size and resize the control.  So ideally, I would want to define all of those things in a control template.  I would like it to

Resizing controls when Maximising


I have a window with 3 Datagrids and couple of Textboxes and labels. When I maximise the window, some of the controls locations are getting messed and the Datagrids are not growing according to the maximised window level

Is there any way that we can set the controls to show properly when we maximise? I have set the Height property of the Grid (Not the Datagrid) to 'Auto', but still the Datagrids are not growing when I maximise


Any help would be appreciated

Dreaming a world without any war in anywhere

How can I make controls inside a Template visible to Code-behind


I have created a custom control that implements Templates (based on Panel controls) ... I can do a FindControl to locate imbedded controls.  This allows me to get and set values in the imbedded controls, but I want to be able to reference the imbedded controls like they are properties of the associated panel.  Here is a sample of how my custom control now works:

<cc:CustomControl ID="myCustomControl" runat="server">
<asp:TextBox ID="myTextBox" runat="server"></asp:TextBox>

I can do the following (where my custom control has given the panel hosting the template the name "myPanel"):

Dim txt As TextBox = myCustomControl.myPanel.FindControl("myTextBox")
txt.Text = "Some text to put in TextBox"

What I want to do is:

myCustomControl.myPanel.myTextBox.Text = "Some text to put in TextBox"

Window resizing problem?


Hi all,

This is my first post and i am not sure how to start explaining my problem, but i want to try.  I am designing a WPF app. The problem i am facing is related to resizing the app's window. I will break the app into the components i am using to give a better picture.



1. A panel - left hand side

2. A tab usercontrol with four tabs(A,B,C,D) - right hand side.


tab A has a text editor from another xaml file(on left hand side) AND another display on the right hand side. Now when i try to resize the window after building the app, the window just starts to hide the display on the left hand side by eating it up.


Is there a function/variable in the WPF designer that i can use to do the resizing such that the compnents in the window will adjust there sizes to accomodate with the mainwindow size??





How do I make 2 controls take up the space in a horizontal row?


I've got to make a small change to my first WPF app.  Right now it has a label with a textbox immediately below it.  The textbox can allow the user to enter data into it.  What the users want is to see different comments to the right of this textbox.

So this is what I thought I would do.  I'll wrap everything up in a stackpanel with a horizontal orientation; perhaps use a wrap panel instead.  And I thought I would replace the label wrapping the textbox with a groupbox instead.  The comment that is to appear to the right of the textbox, may not have any data in it.  If it doesn't, then I thought I would not show it.  This makes it tricky, because what I would like to do is have the groupbox surrounding the textbox take up the full width of "row", rather than have an empty space where the comment would be.  (BTW, I'm thinking of putting the comment into a textblock control and wrapping that with another groupbox.)  How do I do what I want to do?  Should I use a grid control instead?  Ideally, if there's anything in the comments I want the textbox (in it's groupbox) to take up half of that "row", and the textblock (in it's groupbox) to take up the other half, with appropriate margins, but if there's no comment, then the textbox (in it's groupbox) takes up the whole "ro

How to make server controls browser compatible

The article How to make server controls browser compatible was added by suresh.mekkattil on Saturday, May 14, 2011.

Introduction In modern web development, we need to check the browser compatibility for our web pages. This can include changing the css classes, style to fix the design issues. Using ASP.NET we can check the browser compatibility without writing a single

Binding WPF Controls to an Entity Data Model

In this interview, programming writer, McLean Schofield, demonstrates how to bind WPF controls to an entity data model, using Visual Studio 2010 Beta 1. You can also learn more in the topic: Walkthrough: Binding WPF Controls to an Entity Data Model.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend