.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

Transparent WPF window blinks when background is redrawn

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :WPF
Hello everyone. I have a problem with a window which is transparent. If the background changes under the window, you can see that the whole window is redrawn, so it blinks and it doesnt look well.   <Window x:Class="Transparent" WindowStyle="None" AllowsTransparency="True" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Transparent" Background="Transparent" Width="190" Height="200" Topmost="True">   <Canvas Background="#FF444444" Height="200" Width="190" Name="TranspaerntCanvas"></Canvas> </Window> On some changing background it works fine (for example when I put it over a youtube video), but over openGL background the window is blinking. I use .NET 3.5 on win XP. Does anyone know, how to fix this problem? Thank you

View Complete Post

More Related Resource Links

Background window failed to update after MessageBox was closed on 64-bit Windows7

In vs2008, I open a WPF window as background, and then click a button in background window to open the second window. In the second window, I make it WindowStartupLocation CenterScreen and put some controls, and then click a button in the second window to close it and open a messagebox, after closing the messagebox, I find the area behind the messagebox always fails to update in the background window. code of the buttonclick from the second window: this.close(); messagebox.show("*********************")  // after closing the messagebox, the area behind it in the backgound window always fails to update. This issue can only be reproduced in 64-bit windows7 Anyone got idea? Thanks in advance. bruce

WPF transparent window has white box arround it on XP but not vista

Hi I have a WPF Transparent window which works fine on Vista but on XP, there is a white box around it. I am not sure what's causing it on XP, any suggestions will be very much appreciated. R

Page Viewer Web Part - with transparent background?


Hi all, this should be an easy one I hope...

I have a simple page with 1 Page Viewer Web Part that points to a simple app on another website. (basically an IFrame). My portal has a tiled image background, but the application is showing up with a white background.

My question is, is there a simple way to get the web part to have a transparent background, so that my portal background shows up behind it? So that it will look more natural, instead of a white square in the middle of my portal page...

note - the background is transparent in Firefox 3.5.9 for Windows XP, but not in IE8... unfortunately everyone here uses IE8

drag and drop into transparent canvas on transparent window




Short version: how can I drag/drop into a transparent window.


Long version:

I have a transparent borderless window with a transparent canvas in it. The canvas can hold usercontrols that can be dragged around (like gadgets, widgets).

I want the user to be able to click anywhere outside the gadgets but within the canvas and hit whatever that is behind, like other windows from other programs or icons on the desktop for example. This is easy because everything is transparent except the gadgets. The problem comes when I want to drag new gadgets in from another window. When the window and canvas is transparent, it is not allowed to drop anything on them... (the drop target canvas is not registering any mouse events)

So what I want is some kind of partial HitTestVisibility. For MouseDown in the canvas, it should be HitTestVisible=false, but when I drag something (my own stuff, not  files for example) over the canvas, it should be able to drop it.

I have tried setting the opacity of the background to 0.01 when entering the window with the mouse, that works sometimes if I have a small border that the mouseenter event can trigger on, but if I move the mouse to fast, it wont work.... So a 100% fool proof way of enabling Drop on a transparent control would be nice :)



How to freeze the background page when modal popup window called



when i call modal popup extender the background is scrolling , i want to freeze the background page then
 is there any properties or any other idea to get this .. 

Save byte array to Image with transparent background to client machine


I have an asp.net website and am exporting an image from the Report Viewer.  I have created my byte array to get the data from the report viewer and now I need to save an image with transparency to the client machine using the response headers.  I was able to do this by saving the array to the server as a bmp and then adding transparency and saving to the client as a GIF; however, the requirement has changed and now I need to do this without saving the file to the server and even though I have found several solutions using unsafe code these will not work for us because we are not allowed to use unsafe code in our environment. 


So in short I need a way to go from an array of bytes to a transparent gif and save to the client machine without using unsafe code and without saving a file to the server. 

Behind Visible Window (No Transparent Window) ?



My there was a question about WPF.http://social.msdn.microsoft.com/Forums/en/wpf/thread/7190959b-b1c6-4cd3-8108-600becc8b03b

Same question but now subject is Windows Forms.I can making transparent windows (back of form is visible) with below code

this.BackColor = Color.White;
this.TransparencyKey = this.BackColor;

And I have a panel on form object.This panel's background color is transparent.Because panel's behind must be visible...and While Application running ,I'm clicking panel object.Rather I can't click to panel object.When I changed panel's background color to other color (except Color.Transparent) ,I can click panel object.What necessary I need to do ?

C Sharp Coder

Modal popup window in ASP.Net

A Masked div or modal popup window is a child window created from the parent window which prevents the user from interacting with parent window before he returns to the parent application.

Alternating row background for first column of a report


is there a way to make the first column of a report use the an alternating background color? 

I have the background color set for the entire row however it does not work for the first column if the color is set to an expression.  If I just set it to a color i.e. red it works just fine. If I insert a dummy column to the left it works just fine (but the dummy column does not work, presumably because it is first??).

In the file below only the textbox for part number does not show an alternating background.  All others work correctly.

                    <Textbox Name="PartNumber">

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 

Selected to change the background color of the page



As this site, http://www.borfin.com.tr/genel/Default.aspx, How can I change the background color selected pages.

Open PopUp Window From Error httpModule


I would like to open a popup window from the assembly to present the information to the user. Does anyone know if this is possible, I am presently doing the following:

        WriteLine("body {font-family:""Verdana"";font-weight:normal;font-size: .7em;color:black; background-color:white;}")
        WriteLine("b {font-family:""Verdana"";font-weight:bold;color:black;margin-top: -5px}")
        WriteLine("H1 { font-family:""Verdana"";font-weight:normal;font-size:18pt;color:red }")
        WriteLine("H2 { font-family:""Verdana"";font-weight:normal;font-size:14pt;color:maroon }")
        WriteLine("pre {font-family:""Lucida Console"";font-size: .9em}")

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

how to make a css style background image be linked to an image in the resource file


hey guy, i need help in a very troubling matter. I want to make a textbox with a specific style, within this style a set of images as background parts, how can i attach these images to the custom control as whenever i take the .dll file and add it to the toolbar the images do not appear. So i tried to make them as resource files and their property as embedded in .resx file, so how to make the css style background image url to be linked to any of those image.

thanks in advance

problem in consuming WCF service through Window application


I have a silverlight application and WCF service all made in VS 2010 , i had hosted my site to web server which contain Window 2008 and IIS 7.0

now the problem is i have another application which is a window application developed in VS2008 , when i try to add the service reference it gives me error


The document at the url was not recognized as a known document type.

The error message from each known type may help you fix the problem:

- Report from 'DISCO Document' is 'There was an error downloading 'http://dev_qa.emspa.com/HRDev3/Service.svc?disco'.'.

  - The request failed with HTTP status 400: Bad Request.

- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from '' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

Metadata contains a reference that cannot be resolved: ''.

Content Type application/soap+xml; charset

Upload transparent PNG image


Hi everybody

I'm creating a website where it must  be able to upload, crop and resize images. This works until I use transparent PNG images. When I upload a transparent PNG, the transparency becomes black. I've searched the whole internet, but found no solution so far. Can someone help me? This is my code. I'm working with MVC 2.

			try {
				HttpPostedFileBase file = Request.Files["image"];
				file.SaveAs(Server.MapPath("/Uploads/" + file.FileName));

				ViewData["ImageLocation"] = "/Uploads/" + file.FileName;
				return View();
			catch (Exception exc) {
				return RedirectToAction("UploadImage");

Crystal Report parameter value window.


 Hi friends,

   I am using Crystal report which displays the result of stroed procedure which have 2 paramater.

  When i run report it shows two window for getting each parameter.

  My need is, can i have one window for getting all the paramter value for stored procedure.


  With Advanced thanks,






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