window

MVVM WPF change smoothly one window to another

╄→гoц情女王★ 提交于 2019-12-13 04:51:05
问题 I'm doing an app in WPF with design pattern MVVM. I have there fullsize windows(not only maximized but fullsize). I need to switch one window to another(open window B by pressing button x in window A and close window A when window B is showns). I'm closing window A in loaded event in window B but I still can see a desktop for a while before window B is shown. How to do it without seeing desktop? 回答1: Instead of switching between windows, you can have one window with a ContentControl . All you

how to fix window in it's absolute position and don't scroll on browser scroll?

坚强是说给别人听的谎言 提交于 2019-12-13 04:49:23
问题 In ExtJS when I scroll browser window Ext.window.window stays on same position on Viewport. I would like to fix this window on it's absolute position. I saw documentation says: fixed : Boolean Configure as true to have this Component fixed at its X, Y coordinates in the browser viewport, immune to scrolling the document. Defaults to: false But does not work for me. What I am missing? How to fix window in it's absolute position and don't scroll on browser scroll? 回答1: This part works. But

IE11-facing issue while calling focus() on window object

浪子不回头ぞ 提交于 2019-12-13 04:41:55
问题 Trying to run a following simple code on IE11 browser: <!DOCTYPE html> <html> <head> <title>Popup Example</title> <script> function ButtonClick2() { var thewin = window.open("http://www.google.com",'thewin','width=400, height=420,status=no'); window.thewin.focus(); } </script> </head> <body> <button onclick="ButtonClick2()">Click Me!</button> </body> </html> ISSUE:On IE11 it gives the error statement " Unable to get property 'focus' of undefined or null reference" 回答1: This answer's late, but

Two objects in namespace to be default initialized by different functions and used by class within namespace

╄→гoц情女王★ 提交于 2019-12-13 04:34:57
问题 I have a strange request. I have a namespace foo with two declared objects of type bar , namely bar1 and bar2 , which I would like to initialize via constructor of class bar. Is this a sound way to do so: namespace foo { class bar; foo::bar *bar1; foo::bar *bar2; } class foo::bar { /* Initialize bar1 and bar2 in the constructor. */ InitializeBar(); }; The reason behind this shenanigan is I would like to create an object similar to cout and cin such that foo::bar1 and foo::bar2 need not be

Window Resize event

旧城冷巷雨未停 提交于 2019-12-13 04:29:49
问题 I have a program that scales an image to the size of the screen. I currently have a component listener listening for a componentResized event, but this is not what I want. I would like the method to only be called one the user lift's there finger off their mouse, not as they are doing the resizing. This way, my image will not constantly be resizing to the user's specifications. Thanks! 回答1: A solution is to supply a Swing Timer which is reset each time componentResized is called. This injects

Python GUI open a “new page”

僤鯓⒐⒋嵵緔 提交于 2019-12-13 04:23:40
问题 When I press a button, I want to open a new side. Not a new window, the window should be the same, just the interface should change. How can I solve this without opening a new window? from tkinter import * page1=Tk() label1=Label(page1, text="This is page 1") label1.pack() def topage2(): page2=Tk() label2=Label(page2, text="This is page 2") label2.pack() button=Button(page1, text="To page 2", command=topage2) button.pack() mainloop() 回答1: You could create two frames in the same place, and

import cv2 dll load failed

耗尽温柔 提交于 2019-12-13 03:55:51
问题 When I passed on win7 (python3) pip install opencv-python pip install opecncv-contrib-python Can be correct import CV2 But when I installed opencv on window server 2008 R2 enterprise, this was the following error: In [2]: import cv2 --------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-2-c8ec22b3e787> in <module>() ----> 1 import cv2 c:\python36\lib\site-packages\cv2\__init__.py in <module>() 1 import importlib

Run MySql.exe as SystemVariable using PowerShellScript

一曲冷凌霜 提交于 2019-12-13 02:58:39
问题 I successfully added my mysql path to System Variables in Windows variable Path. If I run cmd and then mysql.exe. It will execute the program without problems. I want to run mysql.exe from PowerShell $mysql = "mysql.exe" $params = "-C","-B","-h$server","-P$port","-u$user","-p$password",$db,"-e$query" & $mysql @params I tried ./mysql.exe and mysql.exe but it's not working. I get the error: The term 'mysql.exe' is not recognized as the name of a cmdlet, function, script file, or operable

How to bind ESC key to close a `gwindow()` in gWidgets?

﹥>﹥吖頭↗ 提交于 2019-12-13 02:56:16
问题 Consider: require(gWidgets2) w <- gwindow("notebook example", visible=T) nb <- gnotebook(container=w) gbutton("Page one", label="tab 1", container=nb) ## note label argument gbutton("Page two", label="tab 2", container=nb) How can I bind a given key (say, ESC ) to close the gwindow() in gWidgets, that is to execute dispose(w) ? In other words, how do you assign keybindings in gWidgets? 回答1: With RGtk2 (and possibly others) the addHandlerKeystroke method can be used to catch keystrokes. You

LInk to ntdll.lib and call functions inside ntdll.dll

泄露秘密 提交于 2019-12-13 02:49:39
问题 I'm recently doing some research on private APIs. I tried to call functions such as NtOpenFile in ntdll.dll with LoadLibrary and GetProcAddress at runtime. Luckly, it succeed. This morning I performed a file search on my computer and find ntdll.lib in my C drive. As far as I know of, such .lib file should contain stubs for dll exports available for linking. So, I tried to link my application to that lib but I'm constantly getting unresolved external symbol errors. However, a dumpbin /EXPORTS