473,406 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

WPF Popup problem

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 5102

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

Similar topics

17
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...
7
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...
3
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 +=...
0
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"...
3
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,...
11
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...
7
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...
3
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...
3
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...
3
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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,...
0
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...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.