w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
My inputcommand keybinding to main window does not work when child window is focussed(same wpf window)?
The key bindings will only work if the Form is focused. You could redirect every Command in your new Window to the Main Window Change your Constructor to of the new Window to accept a Main Window and save this window: MainWindow mainWindow; public Window(MainWindow w) { mainWindow = w; } Whenever a Keybinding executes just do something like this: mainWindow.TabPress(); And show the Window with Window childwindow = new Window(this) { Title = "ChildWindow", Width = 200, Height = 300 }; childwindow.Show();

Categories : C#

When opening a 'child window' from the main site do i have to create an HTML page for each child window or is there a way to make it generate its own?
Using "popup" windows can be troublesome.. some browsers will not open them properly due to their internal "popup blockers" but to answer your question. if you set the URL of the window to the image itself it should load in the window without the need for a page. i.e. http://www.example.com/img/myimage.jpg A better way to do this would be using a javascript library such as jQuery and jQuery-UI to open modal overlays.

Categories : Javascript

How to execute main window key binding when child window is focussed in wpf?
WPF Behavior: Global Application Shortcut Keys Seems to be what you're looking for. I made a couple small modifications to the author's code to get your required functionality(rather than passing in an InputBindings collection, made the Behavior pick it from the AssociatedObject directly. Also took out the restriction for requiring modifier keys, Although I suggest you do read through the author's notes in the article and incorporate it to your requirements) Sample download for your requirements ^^ I could get your required behavior, however do go through the Behavior<T> to see if you can optimise it better for yourself(only bit's I actually looked into was just stuff relating to your specific requirement.)

Categories : C#

Opening a child dialog window from a main window with Pyside
If your MainWindow have a Menu action named actionAbout, and a slot called openAbout, all you need to do is connect the triggered signal from the actionAbout to the slot openAbout. self.actionAbout.triggered.connect(self.openAbout) The process is similar to what have you done with the pushbutton. Just change the names used in this example with the ones in your application.

Categories : Python

javascript/jquery : Window.open opens child window but after few seconds child window get automatically closed for some urls(for IE and chrome)
It's because this code is executed on init on https://wpc.gcsip.com/wpc/wpc page // check that this page is not in a subwindow (e.g. after a session time out) if ( window.opener ) { window.opener.location = "wpc"; window.opener.focus(); window.close(); }

Categories : Javascript

window.close closes the postbacked child window and a copy of child window still appears
The showModalDialog method will freeze JavaScript execution on the parent window until the dialog that it opens has closed, so we can rule out that as the reason why your second window opens. When FileUpload.aspx posts back from the server, it should work the same way as modeless aspx postbacks. I think you should be able to get rid of the window.open() method and you should be fine. Parent window: window.showModalDialog("FileUpload.aspx", "FileUpload", "center:yes;resizeable=yes;dialogHeight:300px;dialogWidth:600px;"); The Child window will call this when it's done. window.close();

Categories : Javascript

Access to main window control in UserControl
What you really need is to use MVVM pattern. Use a ContentControl instead. And pass the usercontrol reference to its Content property. you can get idea from it, like : yourContentControl.Content = new UserControl1();

Categories : C#

WPF MVVM Bind User Control to Main Window View Model
try this : CustomerId="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.YourSelectedItem.TheProperty}" I am not sure how to manage your seleted item in window, so please change yourSelectedItem.TheProperty accordingly. Thaks

Categories : Wpf

How to write a popup window to pass the password to main window?
Here is a Demo of how you could proceed for a custom popup & get the password: HTML: <div id="popup"> <div>Enter Password:</div> <input id="pass" type="password"/> <button onclick="done()">Done</button> </div> <button onclick="showPopup()">Show Popup</button> STYLE: #popup { width:160px; height:80px; padding:20px; background-color:gray; position:absolute; top:100px; left:100px; display:none; } SCRIPT: function done() { document.getElementById("popup").style.display = "none"; var password = document.getElementById("pass").value; //DO STUFF WITH PASSWORD HERE }; function showPopup() { document.getElementById("popup").style.display = "block"; }

Categories : Javascript

window.focus to bring main window in front of popup
According to that post, window.focus() won't work on Chrome because it is disabled. It might be the same for Safari.

Categories : Javascript

Window instances - how to get my main window canvas inside other class?
Since you do not want to pass your Canvas around as a parameter, you could try creating an Extension Method which would act on your Canvas Object. namespace CustomExtensions { public static class Shapes { public static Ellipse SomeCircle(this Canvas dest) { Ellipse e = new Ellipse(); double size = 10; e.Height = size; e.Width = size; e.Fill = new SolidColorBrush(Colors.Orange); e.Fill.Opacity = 0.8; e.Stroke = new SolidColorBrush(Colors.Black); dest.Children.Add(e); return e; } } } Usage remember to add the CustomExtensions Namespace to your usings. canvas1.SomeCircle();

Categories : C#

Set focus on user Control's text box when child window is opened
For your first question write this code: public YourChildWindow() { InitializeComponent(); YourTextBox.Focus(); } For second question: You must set the StartupLocation of Child Window as CenterOwner AND set the Owner of child window as ParentWindow before showing the child Window. For example, write this code in the parent window: Window ownedWindow = new Window(); ownedWindow.Owner = this; ownedWindow.Show(); According to http://msdn.microsoft.com/en-us/library/system.windows.window.owner.aspx

Categories : Wpf

Is it possible to receive messages from a parent window which is NOT the main window?
If a control is a child of a tab (or any other control) then it's the tab that will get notification messages like WM_COMMAND. It's easiest to make your controls all children of your main window and just fix the z-order to make them appear in front of the tab (you already have WS_CLIPSIBLINGS set on the tab control, which you would also need). If you leave the controls as children of the tab then the only way to get notification messages is to sub-class the tab. Or, you can do this the way property sheets do it, and use child dialogs (a dialog with the DS_CONTROL style set) to host the tab content. Then you can have a separate dialog procedure that handles messages from the child controls, and it makes it easy to show/hide a whole page of controls rather than handling them all individual

Categories : C++

Hide the icon of main window when navigate to another window
WPF Windows have a ShowInTaskbar property. Set this to false. You may also be interested in this post: C# WPF - Application Icon + ShowInTaskbar = False

Categories : C#

pyGTK how to redisplay a top level window (with child widgets) after window destroy signal is sent
Have you tried making another copy of the window class and showing that one instead? Note: This will reset anything that was set in the window. i.e. if a person did something to make label1 say 'Hi!' instead of 'Hello!', it is going to be reset again to 'Hello!', since you are recreating the window.

Categories : Misc

Closing a process child window (e.g. a Word window) accessing a specific file
I found this very detail post about the subject, maybe it can help you http://forum.sysinternals.com/howto-enumerate-handles_topic18892.html That post hase some disucussions and related questions here http://forum.sysinternals.com/topic19403.html

Categories : C#

How can I show alert in parent window from child popup window in javascript?
try this code <!DOCTYPE html> <html> <head> <script> function openWin() { myWindow=window.open('','','width=200,height=100'); myWindow.document.write("<p>This is 'myWindow'</p>"); refreshParent(); } function refreshParent() { window.parent.focus(); window.parent.alert("message"); window.parent.location.reload(); } </script> </head> <body> <input type="button" value="Open 'myWindow'" onclick="openWin()" /> </body> </html>

Categories : Javascript

Javascript Window.Open how to obtain the opened child window from a different page
First its seen little bit tricky.. you declare some ajax function to send information to server whether child window opened or not.. if child window opened then refresh page. for E.g . -> assume that user opened 2 same page In different tabs1 and tab2. -> user opened opened popup window on tab2 and add/change some information.. -> tab2 content refresh as per ur event. you should also send a one flag to server with session id and tab1 continuous check is that any changes happed to server it will be refresh..

Categories : Javascript

For Chat window.whether i go for dynamic user control or client side div tag pop up window?
I helped write and maintain a simple chat window in ASP.Net WebForms a while back, the way we did it was to use some simple JavaScript making some HTTP requests to a page which had WebMethods on it. The C# page contained a WebMethod for getting new messages from the server which was called from JavaScript running on a setTimeout loop. It also contained a WebMethod for adding new messages to the session. If I recall correctly, some kind of queue was used per user involved in the chat session and all the method for getting new messages did was to map the user to the correct queue and take all the messages that were present at the time. Hopefully this helps.

Categories : Asp Net

Accessing parent window angular scope from child window
I had a similar need and had the same problem accessing the scope using angular.element. I was was able to solve it as follows though: In your main/parent controller do something like this: $scope.food = 'Mac & Cheese'; window.$windowScope = $scope; $window.open('views/anotherWindow.html', '_blank','menubar=yes,toolbar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,personalbar=yes'); Then in the child window controller you can access $windowScope like this: $scope.parentWindow = window.opener.$windowScope; console.log($scope.parentWindow.food); An alternative to putting data directly into the scope would be to use $window scope to broadcast and/or emit events, which is the preferred way of cross-controller communication in angular.

Categories : Javascript

Disable parent window when child popup window is open
Play around with this code in the pop-up: $(window).on("blur", function(){ ... }); This will fire every time the user leaves the window. Inside the argument function you should be able to make the window regain its focus, maybe using $(this).focus() or self.focus(). I haven't tested this myself. Good luck!

Categories : Javascript

How do I make the height of a slider match that of an image relative to the width of the window?
Maybe if you use jsFiddle we could see the CSS along with the HTML and jQuery. I am just learning so excuse the question but I don't understand that the width of the container is set to 100% but the height is 325. Do you not have to say 325px or something?

Categories : Javascript

ExtJS 4.1: Modal Window seems to return control before submitting the window
The store load is asynchronous, you need to wait til it completes before you can filter the data set on the client: store.on('load', function() { store.filter(); }, null, {single: true}); store.load();

Categories : Extjs

Open User Control from user control in main window grid WPF
This is just a guess as you've not provided much information, but I noticed the following issue which may be the culprit. In your first code snippet, you seem to be creating the employee from the MainForm: Dim Empl As New Employee MainGrid.Children.Add(Empl) Grid.SetRow(Empl, 1) Your following comment would seem to confirm that assumption: This is from Window_Loaded event. Menu is User Control, and there I have few buttons to open and operate another user controls. When I press for example button "Question" And yet, in your Employee class, you are creating a brand new instance of MainWindow and then adding data to it: Public Class Employee Dim mw As New MainWindow Private Sub btnQuestionAdd_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles btnQu

Categories : Wpf

How to add Branch window to Main window in android?
Main Window(activity) package com.myproject.testprojectonintent; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class MainActivity extends Activity implements OnClickListener{ /** the button that I've added in the xml*/ Button startBtn; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_screen); /** Get the id of the button from the xml*/ startBtn = (Button) findViewById(R.id.startBtn); startBtn.setOnClickListener( this); } @Override public void onClick(View view) { // TODO Auto-generated method stub /** make

Categories : Android

show Login window before main window
You should set Application.ShutdownMode to OnExplicitShutdown (msdn). Example: <Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml" ShutdownMode="OnExplicitShutdown" > </Application>

Categories : C#

Redraw in parent window in child window's onPaint in mfc
One way is to just pass data to the parent window and call its Invalidate function. Then it would paint the grid lines in its own OnPaint. Or you could paint directly on the parent window from the child, but use the parent's GetDC function instead of using the child's DC.

Categories : C++

SetFocus to parent window, then back to child window
Big thanks to Hans Passant for solving this! The crash issue was due to my window handle being unreliable. I stopped storing the window handle in a variable, and instead I got it on the spot using GetParent(). I also didn't need to set focus to the current window, all I needed to do was replace my SendMessage with a PostMessage. So the new code: case WM_KEYDOWN: ...code to handle modifiers like shift, ctrl, etc... else { PostMessage(GetParent(win32Frame->getPlatformWindow ()), message, wParam, lParam); }

Categories : C++

Call JavaScript of parent window from child window
What you're looking for is a reference to the window that opened the popup window. Once you have that, you can call functions in that window, read and write variables in that window, or even manipulate its DOM. That reference is called opener. It gives you the window object for the window that opened the current window. For example, if you have a function in the original window like this: function updateMe( data ) { alert( data ); } then in the popup window you could call it like this: opener.updateMe( 'Hello!' ); Naturally, you need to make sure that updateMe() is a global function in the original page. Or if you have some object in the original page and updateMe() is a method of that object, you can still do it, as long as the object is global. e.g. in the host page: var myOb

Categories : Javascript

Accessing the Parent Window's Content from the child window
The root of your problem is same origin policy that won't let you observe load events for external domains. If you try this in developer console while browsing SO, everything's fine: var child = window.open( 'http://stackoverflow.com' ); child.onload = function() { alert( 'Popup loaded!' ); // Fired! }; However if you try to open a page from other domain, it fails: var child = window.open( 'http://stackexchange.com' ); child.onload = function() { // It's not gonna be fired unless you run it from stackexchange.com. alert( 'Popup loaded!' ); }; The same thing happens when you call window.open() or window.open( '' ) as it tries to load about:blank page which is out of your domain's scope and that's why your browser won't fire attached events (same for child.addEventListene

Categories : Javascript

Going back from child window to parent window in Visual C++
First of all if you want to do some navigation kind of things then, Your code of going parent to child is also not work properly. Now what I suggest you is that for going from parent to child create one global variable. Like , Form2^ pp ; initialise it in constructor or create method of parent class Like, //Create method or constructor, pp = gcnew Form2(); And do your navigation Like, private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) { this->Hide(); pp->ShowDialog(); } In this case no matter how many time you click on button3 only one instance of child class will show and hide. No your problem is that you want go back to parent window form from child window. You may achieve this using this.Parent as Form Like, priva

Categories : Dotnet

How to get child window url from parent window using javascript
You can't detect the event precisely, but you can do a workaround and check the URL all X milliseconds. var self = this var detectsUrl = setInterval(function(){ var a = winRef.document.createElement('a'); a.href = winRef.document.URL; if (a.hostname == "www.myURL.com") { winRef.close(); clearInterval(detectsUrl); self.callback(); }; }, 1000); // Here we check every seconds

Categories : Javascript

new window appears under main window
As I see it, you have two possible options for making the child Window appear on top of the parent Window. The first was mentioned by @Viv in a comment and that is to set the TopMost property on the child Window to true: omww.Topmost = true; The second option would be to set the Owner property of the child Window to the parent Window (if there is a direct relationship between them): omww.Owner = this; // if called from the parent Window code behind

Categories : C#

How can I link a new window to the main window?
Maybe through one of your button clicks or constructor you can pass: new BorrowSlipServer().setVisible(true); while also adding some parameters to BorrowSlipServer(String s1,String s2) to pass whatever you want to pass from your main to it. It's still not clear what you mean by "link",do you want to pass things from your MainMenu to BorrowSlipServer or do the opposite? On a side note you may wanna add: setLocationRelativeTo(null); This will center your window on run but make sure you add it after you set the frame size.

Categories : Java

WPF close all window from the main window
Try Application.Current.Shutdown(); From MSDN Calling Shutdown explicitly causes an application to shut down, regardless of the ShutdownMode setting. However, if ShutdownMode is set to OnExplicitShutdown, you must call Shutdown to shut down an application. Important note When Shutdown is called, the application will shut down irrespective of whether the Closing event of any open windows is canceled. This method can be called only from the thread that created the Application object.

Categories : C#

How do I bring parent window in front of child modeless dialog when parent window clicked
Take out this line: Owner = Application.Current.MainWindow and you should get the behavior you want. By specifying the owner window you are keeping the child window always in front.

Categories : Wpf

Losing the elemets/objects identity of same objects in parent window when renavigating from child window
When u navigate from the parent window a stale element reference exception is thrown each time you interact with the previously found web elements. In this case, although the replacement elements may look identical they are different; the driver has no way to determine that the replacements are actually the same or what's expected. If the element has been replaced with an identical one, a useful strategy is to look up the element again. To learn more, read this.

Categories : Selenium

How to manage resources in a console app that creates main window in main()?
Thanks to slugster's posting Access ResourceDictionary items programmatically I was able to load the resources programmatically in my app's loaded event. Example: ResourceDictionary dict = new ResourceDictionary(); dict.Source = new Uri("../Resources/PageDictionary.xaml", UriKind.Relative); Application.Current.Resources.MergedDictionaries.Add(dict); I'm not sure if this is the best solution but it does what I wanted.

Categories : C#

Is there any way to hide Chrome window and capture a screenshot or convert the Chrome window to image?
edit I've added a process refresh and thread wait that should fix the problem of not having a MainWindowHandle when Chrome launches. Things to note: Process.Refresh will only work if another instance of chrome is NOT running (if chrome is already running the new Process will cause a new tab to be opened and will exit, hence process.Refresh will fail) - other approaches are possible to avoid this problem. The thread sleep value might need to be tweaked for your needs, but some sort of wait period is necessary for the window handle to be created and the page to load. end of edit this should do it it starts a process (notepad.exe in this case) waits until it's loaded for user input and gets the main window handle takes a print screen of the given process (I've used the solution Mauric

Categories : C#

Centering slider in the window
You don't need your .ctn element to have a width of 100% to accomidate the child. You want to set it to the width that your slider should occupy (maybe 960px or 1120px or whatever) and center that. Probably need to set overflow hidden as well. Your .cnt-block-wrap width of 5200px will accommodate the slides inside. .cnt { height: 100%; margin: 0 auto; overflow: hidden; width: 960px; position: relative; }

Categories : CSS



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.