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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to create a wpf-dialog window with constant height?

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :WPF
Good afternoon. I need to create a dialog wpf-window with the constant height. One can see a window height in wpf-editor, and set this value to MinHeight and MaxHeight properties. Here's a simple XAML-code: <Window x:Class="ClassName" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="94" Width="243" MaxHeight="94" MinHeight="94"> <Grid> <Button Content="Button" Height="23" HorizontalAlignment="Left" Name="button1" VerticalAlignment="Top" Width="75" /> <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="146,32,0,0" Name="button2" VerticalAlignment="Top" Width="75" /> </Grid> </Window> However, when running the application, one sees the window has a larger height. What's the bug? Tell me please, how to make a dialog wpf-window with the constant height?

View Complete Post

More Related Resource Links

Create a user friendly pop up window


Hello friends I am new to asp.net programming. While working with windows form(windows application) i have created a window for editing purpose(just like popup window ) which contains three bounded dropdown list a button and a gridview. After making selections from the drop down when we press button the corresponding result should display in a grid.After that when you click on the grid row it will load the corresponding datas in my form. i want to create such control in asp.net . i have to use jquery or ajax.And this pop up window i have to use more than twenty times in my application.am using VS2008 ASP.NET and C# 3.5 . Plese suggest me what to do. Thanks in advance

Aero Glass: Create Special Effects With The Desktop Window Manager


In this article we introduce the Desktop Window Manager, the new interface that manages how windows are rendered on the Windows Vista desktop.

Ron Fosner

MSDN Magazine April 2007

Closing Javascript Modal dialog window after server side event processing


Hello Friends..

Please tell me how to close Javascript ModelDoalog Window.. after Server Side event Processing .

Basically i want close window in  finally Block After sucessfulll Updation.

AMit..... InnocentInnocentInnocentInnocentInnocentInnocentInnocent

IE Process Start and Window Height

Hi, I'm working on a tool for cross-browser testing: the idea being that a WinForms app will open a range of URLs over a range of browsers, and save each out as a screenshot. I have a problem with Internet Explorer though - namely that the opened window thinks it's a lot larger than it actually is... Background: I've got some javascript/jQuery, that happily reads a parameter from a URL, and scrolls a page down - so for example http://mypage/?scroll=1 will show the top part of a web page, http://mypage/?scroll=2 shows the second part, and so forth. The scrolling mechanism uses $(window).height() and $(document).height() - both of which are standard javascript methods that work happily.   $(document).ready(function () { var windowHeight = $(window).height(); var documentHeight = $(document).height(); alert("Window Height: " + windowHeight + "px, Document Height: " + documentHeight + "px" ); });   If I open my url in IE normally, it picks up (for example) a window height of 880px - which is correct since my screen is 1050px high, minus a bit for the IE toolbars/furniture. In my WinForms application, I can open IE happily with one of the scrollable urls - namely   process.StartInfo.CreateNoWindow = false ; process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized; process.StartInfo.FileName = "iexpl

Locating a XUL pop up dialog window

What type of command should I be using in Javascript to reference a XUL pop up window? The pop up is not a browsing window, but a strict dialog window. Document.getBrowser.??? or something??? I need a reference like this to do some kind of innerHTML to the window?hours and hours in google really wears me out!!! ---> Anybody have a few lines of code handy I can either try or use as reference in a google search?

Fail to create window in C++ DLL called from C#

Can anyone help here, please? http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/5b47544c-8151-4c8a-a8c3-14fbeabbbb41 Thanks in advance.

WPF Window as Modal Dialog, strange behavior

Hopefully someone has a clue.... My application displays WPF Window as a modal dialog box. The dialog box has a few child user controls, one of which has combo box. When the user clicks this combo box to select... the whole dialog disappears except of the innards of the combo box. So the user only sees the list box of the combo box. Here are the details I got from the  client: The window itself is launched from non WPF application (Lotus Notes). This happens only on a few machines. The OS is Windows XP SP3. There is no issue with the parent handle, windows owner, etc... I've seen this behavior during the development phase, only when running under a debugger.    Thanks, Michael        

how to create a login window from where user could login from their gmail or others id and write the

hello friends,i m currently creating an article module, and i want if user wana comment on to the any particular artical, than he should login any of his mail id like gmail, yahoo hotmail etc and than post his or her comment and after than comment should go into the DB..., i know i have to use the google contact api and etc but how to use, ur help would be appriciable.....thanks and regardsInderjeet Singh

How to create a window a user can move around inside of a flow panel?

I have a flow panel that contains 3 panels within it. I'd like to allow my users to control the order of the panels and have minimize and maximize capabilities for each of these panels as if they where true window forms.

Wrong window height when running the WPF App



I have the XAML code below with a fixed width and height but when I run the application it is changing the height automatically. How can I fix this?

Here's the code:

<Window x:Class="Vodia.Clinica.LoginWindow"
    Title="Clínica - Login" Height="225" Width="388" Topmost="True" WindowStartupLocation="CenterScreen" WindowStyle="None" ResizeMode="NoResize">
    <Border BorderBrush="Black" BorderThickness="1">
          <ColumnDefinition Width="70" />
          <ColumnDefinition Width="*" />

        <Border Grid.Column="0" Grid.Row="1" Background="LightGray"></Border>

        <Image Height="32" HorizontalAlignment="Left" Margin="21,26,0,0" Name="imgCadeado" VerticalAlignment="Top" Width="32" Source="/Vodia.Clinica;component/Images/base_key_32.png" />
        <Label Content="Usuário" Grid.Column="1" 

Animate window height


Hi, All:


I have a storyboard which reduce my window height to 40. See below:


            <Storyboard x:Key="StoryBoard_Collapse">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="me" Storyboard.TargetProperty="Height">
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="40">
                            <KeySpline ControlPoint1="0.175,0" ControlPoint2="1,1"/>

New window with width and height identitical to the page content


hi all forum

I have my NewsDetails.aspx page which displays a certain news  in a gridview according to the NewsId query string field. i wish to make the user able to print the page or mail it to a friend  so I used the following code

protected void ArticleGrid_RowCommand(object sender, GridViewCommandEventArgs e)
        if (e.CommandName == "print")
            int NewsId = int.Parse(e.CommandArgument.ToString());
            string url = "ForPrint.aspx?NewsId=" + NewsId;
            string js = "<script language='JavaScript'>window.open('" + url + "','" + ArticleLbl.Text + "',";
            js += "'top=0,left=0,status=no,width=710,height=700,resizable=no,scrollbars= yes');";
            js += "</script>";
            ClientScript.RegisterClientScriptBlock(this.GetType(), &

How to create Reponse.Redirect open with new window...c# .net


I am working on a C# .net application in which I need to open a new browser and direct users to it in the event they click on a button or image.

i want to keep the main page and opens a new window browser once the user click the button.

here's my code.

aspx page.

<asp:Button ID="previewbtn" runat="server" Text="PREVIEW " OnClick="previewbtn_Click" />

code behind:

Response.Redirect("newpage.aspx?bg=" + Session["user"].ToString() + "&dc=" + Session["dcode"].ToString());

WPF window dialog fails to open at centerparent?


bizarely strange. i just want to open a WPF window dialog from my main window and have it open at the center of my main application. But it seems not working despite using the FormStartPosition.

I am using .NET3.5. anyone with the same issue?



1 + 1 = 3

Create an internal dialog


I'm trying to track down information how I can create my own custom dialog with a silverlight control placed inside (Like the one when you click tags and notes not a web dialog).


I'm struggling to track down the information on how to do this any help is much appriciated.


Modal Dialog height in SharePoint 2010


In SharePoint 2010, I know the Modal dialog height is calculated dynamically in Javascript. For some dialogs, I mean if the dialog is opening a edit form then it includes ribbon on top of it which reduces the height of the scrolling part and it really looks ugly. Is there any way to add ribbon height to modal dialog height so that unscrollable ribbon height doesn't affect the scrollable area height? Hope I am explaning it correct.

I would really appreciate, if anyone can reply for me.




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