473,569 Members | 2,788 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WPF Popup problem

17 New Member
I have a little problem in a XAML application. When I use a popup in a
WPF application, I am not able to get rid of the popup from the view
even if I do Alt-Tab to move focus to other applications.

Even I have set stayopen=false

Following is the code which I have done.
Expand|Select|Wrap|Line Numbers
  1.  <!-- Middle Product List --> 
  2.         <GroupBox Grid.Column="1" Grid.Row="2"> 
  3.             <ScrollViewer VerticalScrollBarVisibility="Disabled"  HorizontalScrollBarVisibility="Disabled"> 
  4.                 <ListBox Style="{DynamicResource PhotoListBoxStyle}"  
  5.                 Name ="PhotoListBox"  
  6.                 Margin="5"  
  7.                 SelectionMode="Single"  
  8.                 ItemsSource="{Binding}"  
  9.                 HorizontalAlignment="Center"  
  10.                 VerticalAlignment="Center"  
  11.                 SelectedIndex="0"        
  12.  
  13.                 > 
  14.                     <ListBox.ItemTemplate> 
  15.                         <!--<DataTemplate> 
  16.                     <Image Source="{Binding Path=ProductImagePath}" /> 
  17.                 </DataTemplate>--> 
  18.  
  19.                         <DataTemplate > 
  20.                             <Grid VerticalAlignment="Center" HorizontalAlignment="Center" Margin="6"> 
  21.                                 <!-- Drop Shadow --> 
  22.                                 <Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="4" Background="#44000000"> 
  23.                                     <Border.RenderTransform> 
  24.                                         <TranslateTransform X="5" Y="5" /> 
  25.                                     </Border.RenderTransform> 
  26.                                     <Border.BitmapEffect> 
  27.                                         <BlurBitmapEffect Radius="8" /> 
  28.                                     </Border.BitmapEffect> 
  29.                                 </Border> 
  30.                                 <!-- Image Template --> 
  31.                                 <Border Padding="4" Background="White" BorderBrush="#22000000" BorderThickness="1"> 
  32.                                     <StackPanel Orientation="Vertical"> 
  33.                                         <Image Height="150" Width="100" Source="{Binding Path=ProductImagePath}"/> 
  34.                                         <!--<Label Content="{Binding Metadata.DateImageTaken}"> 
  35.                                             <Label.ToolTip> 
  36.                                                 Only JPeg images with a stored thumbnail will display a thumbnail during preview. 
  37.                                             </Label.ToolTip> 
  38.                                         </Label>--> 
  39.                                     </StackPanel> 
  40.                                 </Border> 
  41.                             </Grid> 
  42.                         </DataTemplate> 
  43.  
  44.                     </ListBox.ItemTemplate> 
  45.  
  46.                     <ListBoxItem HorizontalContentAlignment="Stretch"  Background="Blue"></ListBoxItem> 
  47.                     <ListBoxItem HorizontalContentAlignment="Stretch" Background="Blue" Name="ListBoxItem1">Click Me</ListBoxItem> 
  48.                     <ListBoxItem HorizontalContentAlignment="Stretch" Background="Blue"></ListBoxItem> 
  49.                 </ListBox> 
  50.             </ScrollViewer> 
  51.         </GroupBox> 
  52.  
  53.  
  54.  <!-- Pop-Up Product Information Window --> 
  55.         <Popup Name="ProductInfo"  
  56.                    StaysOpen="False"    
  57.                    Placement="Center"   
  58.                    MaxWidth="200" 
  59.                    PopupAnimation="Slide"  
  60.                    AllowsTransparency = "False"> 
  61.  
  62.             <Border BorderBrush="Beige"  
  63.                                 BorderThickness="2"  
  64.                                 Background="White"> 
  65.  
  66.  
  67.                 <TextBlock Name="abc" Margin="10"   
  68.                                        TextWrapping="Wrap" >  
  69.                                 For more information, see 
  70.                             </TextBlock> 
  71.  
  72.             </Border> 
  73.         </Popup> 
  74.         <!-- Pop-Up Product Information Window --> 
  75.  
This is a code behind
Expand|Select|Wrap|Line Numbers
  1. Public Class PopupTest 
  2.  
  3.     Private Sub run_MouseEnter(ByVal sender As Object, ByVal e As MouseEventArgs) 
  4.         popLink.IsOpen = True 
  5.     End Sub 
  6.  
  7.     Private Sub lnk_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) 
  8.         Process.Start((CType(sender, Hyperlink)).NavigateUri.ToString()) 
  9.     End Sub 
  10.  
  11.     Private Sub ListBoxItem1_Selected(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles ListBoxItem1.Selected 
  12.         popLink.IsOpen = True 
  13.     End Sub 
  14. End Class 
  15.  
  16.  
case 1 : When I clicked on the term, it will popup and disapear when I clicked outside anywhere
Case 2 : I have listbox and have a list item named "click me" , when I clicked on this list item the popup will appear but when I click outside anywhere it is not going to be disapear.


Please help me to solve this problem


Thanking you in advanced
Dec 2 '08 #1
0 5116

Sign in to post your reply or Sign up for a free account.

Similar topics

17
2502
by: Applebrownbetty | last post by:
Hi, I'd like to append/amend the following code from the Dreamweaver extension "Open Picture Window Fever" for the ability to center the PopUp window: By default, it allows the window to be offset on the left and top, but does not include a centering option. I'm thinking it would include something like (screen.width-imageWidth)/2;...
7
3208
by: E Michael Brandt | last post by:
I have been lurking here for some time, and now would like to ask a question of you clever coders: My JustSo PictureWindow 3 Extension for Dreamweaver has stumbled in the face of the new Opera 8. Jspw3 opens a popup window (using varname=window.open(...)) but there are now two problems: 1) Opera8 interprets a top,left of 0,0 to be top...
3
1984
by: ypress | last post by:
Hi. I have a page that contains this simple function: <script language="javascript"> function openPop(url, name, w, h) { var features = ""; features += "scrollbars=no,"; features += "menubar=no,"; features += "resizable=no,";
0
1478
by: Dimitrios Mpougas | last post by:
Hello, I have two asp.net pages. The first is a page (main.aspx) wich has four links on it. The href value of each link is: href="view.aspx?id=1" traget="_blank" href="view.aspx?id=2" traget="_blank" href="view.aspx?id=3" traget="_blank" href="view.aspx?id=4" traget="_blank"
3
2155
by: EnjoyNews | last post by:
I have a popup problem. I have a script that generates a popup for image viewing. It has 2 function, and the first is that it automaticly generates the popup window to the size of the image, and the second is that it closes the popup window when you click outside of it. It is a script I have found on the internet, since I have no...
11
7324
by: Alex.Svetos | last post by:
Hello, I'm trying to get a popup to keep focus when it is re-clicked. The script below is supposed to produce this exact behaviour, however it doesn't work, at least on firefox 1.0.7 and moz 1.7.12 (linux kubuntu). It does work with konqueror. It seems to work with firefox on windows but not with IE (not completly sure though).
7
3655
by: anthony.turcotte | last post by:
Hi, I've looked for a solution to this problem on google, read posts in this newsgroup and I still haven't found anything that could help me. Here's the scenario. 1. User accesses pageA.html 2. User clicks on menu link to open popup.html 3. pageA.html checks if popup.html is already open. It is not, open
3
6832
by: atn2002 | last post by:
I'm trying to create a control which when the mouse button gets pressed on one div an absolute positioned div pops up in place of the cursor. From there the cursor should interact with the dialog before the mouse button is released. In other words one element will catch onmousedown, display the popup, and the popup element will catch...
3
4502
by: Yisehaq | last post by:
Hi guys I am trying to prepare few html pages which contain OLAP cubes on a CD. The problem I have is that the popup blocker blocks the OLAP modules from being shown. Therefore, I wanted to write script that will check if the popup blocker is enabled and tell the user to allow the site. I tried my own scripts and after several tries I looked...
3
2761
by: cmo | last post by:
Well I hope I this isn't too nebulous of a problem. The problem I currently have is this: I have a button in a form that opens up a javascript/css poup that has an input field and two ahref links for ok and cancel, both of which call the popup's toggle() method (same thing that is called from the button). The form that this button is in has...
0
7697
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...
0
7924
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. ...
0
8120
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...
1
5512
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
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...
0
3653
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...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
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 we have to send another system
0
937
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...

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.