// Stuff here taken from WPF tutorial // https://msdn.microsoft.com/en-us/library/ms751761%28v=vs.110%29.aspx private void RunExpKai_Loaded(object sender, RoutedEventArgs e) { // Create the interop host control. System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); // Create Shockwave Flash control. AxShockwaveFlash flash = new AxShockwaveFlash(); // Assign the shockwave flash control as the host control's child. host.Child = flash; // Add the interop host control to the Grid // control's collection of child controls. this.grid_winformshost.Children.Add(host); string swf_path = System.IO.Directory.GetCurrentDirectory() + "\\api_port.swf"; flash.Location = new System.Drawing.Point(0, 0); flash.LoadMovie(0, swf_path); flash.AllowScriptAccess = "always"; this.flashproxy = new ExternalInterfaceProxy(flash); //string msg = this.flashproxy.Call("api_mission", null).ToString(); }
public MouseHandler(System.Windows.Forms.Integration.WindowsFormsHost host, Panel panel) { _boundingBoxes = new Dictionary <SelectionType, List <SceneNode> >(); _translateFreeDragging = false; _panel = panel; _host = host; }
private void Window_Loaded(object sender, RoutedEventArgs e) { // Create the interop host control. host = new System.Windows.Forms.Integration.WindowsFormsHost(); //host. host.Width = 320; host.Height = 240; // Create the ActiveX control. barcodeDecoder = new AxBarcodeReaderLib.AxBarcodeDecoder(); // Assign the ActiveX control as the host control's child. host.Child = barcodeDecoder; // Add the interop host control to the Grid control's collection of child controls. this.grid1.Children.Add(host); // sets barcode types barcodeDecoder.BarcodeTypes |= 0x40000000; //add QRCode decoding barcodeDecoder.SetProperty("LinearVerify", true); barcodeDecoder.ShowImage = true; //barcodeDecoder.DecodeFile("c:\\1\\1.jpg"); }
public AspectControl(AspectWindow win) { InitializeComponent(); WinInstance = win; // Create the interop host control. System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); AspectCore.GlobalData.traceAction = Helpers.OutputWindowHelper.WriteOutput; VSInterop ide = new VSInterop(WinInstance); // Assign the MaskedTextBox control as the host control's child. awp = new AspectWindowPane(ide); host.Child = awp; if (AspectPackage.dte != null && AspectPackage.dte.Solution != null) { string FileName = AspectPackage.dte.Solution.FullName.Replace(".sln", AspectCore.Strings.DefaultAspectExtension); if (FileName != "") awp.OpenOrCreateAspectFile(FileName); } // Add the interop host control to the Grid // control's collection of child controls. this.grid1.Children.Add(host); }
private void Window_Loaded(object sender, RoutedEventArgs e) { var host = new System.Windows.Forms.Integration.WindowsFormsHost(); host.Child = browser1; this.grid1.Children.Add(host); }
public CEFBrowser() { InitializeComponent(); host = new System.Windows.Forms.Integration.WindowsFormsHost(); this.grd.Children.Add(host); }
private void GenerateControls() { System.Windows.Forms.MaskedTextBox maskedTextBox; System.Windows.Forms.Integration.WindowsFormsHost host; host = new System.Windows.Forms.Integration.WindowsFormsHost(); maskedTextBox = new System.Windows.Forms.MaskedTextBox("00/00/0000"); host.Child = maskedTextBox; rightPanel.Children.Add(new Border() { Child = host }); host = new System.Windows.Forms.Integration.WindowsFormsHost(); maskedTextBox = new System.Windows.Forms.MaskedTextBox("00/00/0000"); host.Child = maskedTextBox; rightPanel.Children.Add(new Border() { Child = host }); host = new System.Windows.Forms.Integration.WindowsFormsHost(); maskedTextBox = new System.Windows.Forms.MaskedTextBox("(000)-000-0000"); host.Child = maskedTextBox; rightPanel.Children.Add(new Border() { Child = host }); host = new System.Windows.Forms.Integration.WindowsFormsHost(); maskedTextBox = new System.Windows.Forms.MaskedTextBox("00000"); host.Child = maskedTextBox; rightPanel.Children.Add(new Border() { Child = host }); }
public MainWindow() { InitializeComponent(); System.Windows.Forms.UserControl control = new System.Windows.Forms.UserControl(); control.Width = 100; control.Height = 100; control.BackColor = System.Drawing.Color.Black; System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); host.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch; host.VerticalAlignment = VerticalAlignment.Stretch; host.Child = control; _remoteVideo.Children.Add(host); RemoteHwnd = control.Handle; remoteCtl = control; control = new System.Windows.Forms.UserControl(); control.Width = 100; control.Height = 100; control.BackColor = System.Drawing.Color.Black; host = new System.Windows.Forms.Integration.WindowsFormsHost(); host.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch; host.VerticalAlignment = VerticalAlignment.Stretch; host.Child = control; _localVideo.Children.Add(host); LocalHwnd = control.Handle; localCtl = control; this._roomNameInput.Text = "test"; this._userIdInput.Text = Guid.NewGuid().ToString().Split('-')[0]; this.WC.FrameCaptured += this.OnWaveFrameCaptured; this.WC.Init(2); this.SC.FrameCaptured += this.OnScreenFrameCaptured; var screen = System.Windows.Forms.Screen.PrimaryScreen; this.SC.Init(screen.GetHandle(), 0, 0, screen.Bounds.Width, screen.Bounds.Height, 0); }
public ChartFormatWindow(System.Windows.Forms.Integration.WindowsFormsHost ChartWindow) { this.ChartWindow_fer = ChartWindow; InitializeComponent(); WidthTextBox.Text = ChartWindow.ActualWidth.ToString(); HeightTextBox.Text = ChartWindow.ActualHeight.ToString(); }
public void CreateDrawingPDF() { WFHost = PDM pdm = new PDM(); pdm.getDrawing(PartNumber, WFHost); }
private void Window_Loaded(object sender, RoutedEventArgs e) { System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); host.Child = webBrowser; this.webBrowserGrid.Children.Add(host); webBrowser.ScriptErrorsSuppressed = true; }
private UIElement GetPreviewControl(IPresentation presentation) { if (presentation == null) { this.previewBorder.Child = null; return(this.previewBorder); } else if (!presentation.Preview.IsPreviewAvailable) { this.previewBorder.Child = null; return(new TextBlock { Text = Resource.vNoPreviewAvailable, TextAlignment = TextAlignment.Center, Foreground = Brushes.Black }); } else if (presentation.Preview is WordsLive.Presentation.Wpf.WpfPreviewProvider) { this.previewBorder.Child = (presentation.Preview as WordsLive.Presentation.Wpf.WpfPreviewProvider).WpfPreviewControl; return(this.previewBorder); } else { var host = new System.Windows.Forms.Integration.WindowsFormsHost(); host.Child = presentation.Preview.PreviewControl; this.previewBorder.Child = host; return(this.previewBorder); } }
private void PageLoaded(object sender, RoutedEventArgs e) { host = new System.Windows.Forms.Integration.WindowsFormsHost(); pdfviewer = new AxAcroPDFLib.AxAcroPDF(); host.Child = pdfviewer; this.Stage.Children.Add(host); pdfviewer.setShowToolbar(false); pdfviewer.setShowScrollbars(true); PageDataExchange sInstance = PageDataExchange.getInstance(); Dictionary<String,Object> bundle = sInstance.getExtra(PageDocument.TAG); Object action; bundle.TryGetValue( PageDataExchange.KEY_SENDER_VALUE, out action); if (action != null) { if (MenuControl.ACTION_MANUAL.Equals(action.ToString())) { mDocumentFile = ManualFile; } else if (MenuControl.ACTION_ELECTRIC.Equals(action.ToString())) { mDocumentFile = ElectricFile; } } String filePath = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName); pdfviewer.LoadFile(Path.Combine(filePath, mDocumentFile)); }
private void CreateDiagramTab(Diagram diagram) { // Create tab items and add them to the tab control TabItem tabItem = new TabItem(); tabItem.Header = diagram.Title; tabControl.Items.Add(tabItem); // Create a new grid to host other controls Grid grid = new Grid(); // Create WindowsFormsHost and add it to grid System.Windows.Forms.Integration.WindowsFormsHost displayHost = new System.Windows.Forms.Integration.WindowsFormsHost(); grid.Children.Add(displayHost); // Create display and assign it to the WinFormsHost // Display display = new Display(); // Connect with other NSHape components display.DiagramSetController = diagramSetController; display.PropertyController = propertyController; display.Diagram = diagram; // Setup display properties display.BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.ControlDark); display.BackColorGradient = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.ControlLight); display.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; displayHost.Child = display; // Set the grid as the content of a tab item tabItem.Content = grid; }
public AspectControl(AspectWindow win) { InitializeComponent(); WinInstance = win; // Create the interop host control. System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); AspectCore.GlobalData.traceAction = Helpers.OutputWindowHelper.WriteOutput; VSInterop ide = new VSInterop(WinInstance); // Assign the MaskedTextBox control as the host control's child. awp = new AspectWindowPane(ide); host.Child = awp; if (AspectPackage.dte != null && AspectPackage.dte.Solution != null) { string FileName = AspectPackage.dte.Solution.FullName.Replace(".sln", AspectCore.Strings.DefaultAspectExtension); if (FileName != "") { awp.OpenOrCreateAspectFile(FileName); } } // Add the interop host control to the Grid // control's collection of child controls. this.grid1.Children.Add(host); }
/// <summary> /// Create <see cref="System.Windows.Window"/> and <see cref="IRenderHost"/> for it. /// </summary> private static IRenderHost CreateWindowWpf(System.Drawing.Size size, string title, Func <IntPtr, IRenderHost> ctorRenderHost) { var window = new System.Windows.Window { Width = size.Width, Height = size.Height, Title = title, }; var hostControl = CreateHostControl(); // create forms host (wrapper for wpf) var windowsFormsHost = new System.Windows.Forms.Integration.WindowsFormsHost { Child = hostControl, }; window.Content = windowsFormsHost; window.Closed += (sender, args) => System.Windows.Application.Current.Shutdown(); window.Show(); return(ctorRenderHost(hostControl.Handle())); }
public UIElement RenderHelp(string htmlHelp, IList <InstantHelpEventArgs.HtmlExample> htmlExamples) { var tabs = new TabControl(); var tab = new TabItem { Header = "Help" }; var host = new System.Windows.Forms.Integration.WindowsFormsHost(); var myBrowser = new WebBrowser { ScriptErrorsSuppressed = true, DocumentText = _instantHelpHtmlTemplate.AsTemplated(new { Styles = _stylesForTemplates, Body = htmlHelp }) }; host.Child = myBrowser; tab.Content = host; tabs.Items.Add(tab); foreach (var example in htmlExamples) { tab = new TabItem { Header = "Example" }; tabs.Items.Add(tab); host = new System.Windows.Forms.Integration.WindowsFormsHost(); myBrowser = new WebBrowser { ScriptErrorsSuppressed = true, DocumentText = GetExampleHtml(example) }; host.Child = myBrowser; tab.Content = host; } return(tabs); }
private void PageLoaded(object sender, RoutedEventArgs e) { host = new System.Windows.Forms.Integration.WindowsFormsHost(); pdfviewer = new AxAcroPDFLib.AxAcroPDF(); host.Child = pdfviewer; this.Stage.Children.Add(host); pdfviewer.setShowToolbar(false); pdfviewer.setShowScrollbars(true); PageDataExchange sInstance = PageDataExchange.getInstance(); Dictionary <String, Object> bundle = sInstance.getExtra(PageDocument.TAG); Object action; bundle.TryGetValue(PageDataExchange.KEY_SENDER_VALUE, out action); if (action != null) { if (MenuControl.ACTION_MANUAL.Equals(action.ToString())) { mDocumentFile = ManualFile; } else if (MenuControl.ACTION_ELECTRIC.Equals(action.ToString())) { mDocumentFile = ElectricFile; } } String filePath = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName); pdfviewer.LoadFile(Path.Combine(filePath, mDocumentFile)); }
public MainWindow() { InitializeComponent(); _propertyGrid = new PropertyGrid(); AddTypeDescriptorAttributes(); ApplyStyleToPropertyGrid(); System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); host.Child = _propertyGrid; propertyGridHost.Children.Add(host); if (File.Exists(GAMEDATA_FILE_NAME)) { NameResolver.TweakDbResolver = new SqliteResolver(GAMEDATA_FILE_NAME); } if (File.Exists(SETTINGS_FILE_NAME)) { _settings = JsonConvert.DeserializeObject <Settings>(File.ReadAllText(SETTINGS_FILE_NAME)) ?? Settings.Default; } else { _settings = Settings.Default; } }
private void Window_Loaded(object sender, RoutedEventArgs e) { // Create the interop host control. host = new System.Windows.Forms.Integration.WindowsFormsHost(); viruscontrol = new VirusInterfaceMod(); host.Child = viruscontrol; this.VirusGrid.Children.Add(host); }
/// <summary> /// Initializes a new instance of the <see cref="MovieControl"/> class. /// </summary> public MovieControl() { // set the model to page model this.DataContext = PageModel.GetInstance; // initialise the movie model new MovieControlModel(Dispatcher, this.ComponentName); // bind events MovieControlModel.GetInstance.FileCacheManager.CacheLoadingStarted += FileCacheManager_CacheLoadingStarted; MovieControlModel.GetInstance.FileCacheManager.CacheLoadingComplete += FileCacheManager_CacheLoadingComplete; InitializeComponent(); // Create the interop host control. System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); host.Focusable = false; // Create the ActiveX control. AxWMPLib.AxWindowsMediaPlayer axWmp = new AxWMPLib.AxWindowsMediaPlayer(); // Assign the ActiveX control as the host control's child. host.Child = axWmp; // Add the interop host control to the Grid // control's collection of child controls. this.mediaPlayerGrid.Children.Add(host); // initialise media models new MediaPlayerModel(axWmp); }
private void TimeSpiker_Loaded(object sender, RoutedEventArgs e) { // Create the interop host control. System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); // Create the MaskedTextBox control. dateTimePicker = new DateTimePicker(); dateTimePicker.Format = DateTimePickerFormat.Custom; dateTimePicker.CustomFormat = "HH:mm:ss"; dateTimePicker.ShowUpDown = true; // Assign the MaskedTextBox control as the host control's child. if (version == false) { dateTimePicker.Value = DateThis.AddSeconds(0); } host.Child = dateTimePicker; // Add the interop host control to the Grid // control's collection of child controls. this.TimePiker.Children.Add(host); }
/// <summary> /// Code to show browser based content, applicable for URL's /// If the Header value is not provided, the content is projected in full screen mode /// </summary> /// <param name="Content"></param> /// <param name="header"></param> private void ShowBrowser(String Content, String header) { try { //Check if header is null //Null - Show full screen content if (String.IsNullOrEmpty(header)) { //Show the full screen video control //Display HTML content host = new System.Windows.Forms.Integration.WindowsFormsHost(); browserElement = new System.Windows.Forms.WebBrowser(); browserElement.ScriptErrorsSuppressed = true; helper = new Utilities.ScriptingHelper(this); browserElement.ObjectForScripting = helper; host.Child = browserElement; helper.PropertyChanged += helper_PropertyChanged; FullScreenContentGrid.Children.Clear(); FullScreenContentGrid.Children.Add(host); FullScreenContentGrid.Visibility = Visibility.Visible; FullScreenVideoGrid.Visibility = Visibility.Collapsed; } else { TitleLabel.Text = header; host = new System.Windows.Forms.Integration.WindowsFormsHost(); browserElement = new System.Windows.Forms.WebBrowser(); browserElement.ScriptErrorsSuppressed = true; helper = new Utilities.ScriptingHelper(this); host.Child = browserElement; browserElement.ObjectForScripting = helper; helper.PropertyChanged += helper_PropertyChanged; ContentGrid.Children.Clear(); ContentGrid.Children.Add(host); ContentGrid.Visibility = Visibility.Visible; FullScreenContentGrid.Visibility = Visibility.Collapsed; FullScreenVideoGrid.Visibility = Visibility.Collapsed; VideoGrid.Visibility = Visibility.Collapsed; } String fileLocation = Helper.GetAssetURI(Content); String pageUri = String.Empty; //Local file if (File.Exists(fileLocation)) { String[] PathParts = fileLocation.Split(new char[] { ':' }); pageUri = "file://127.0.0.1/" + PathParts[0] + "$" + PathParts[1]; } //Web hosted file else { pageUri = Content; } browserElement.Navigate(pageUri); this.UpdateLayout(); } catch (Exception ex) { RippleCommonUtilities.LoggingHelper.LogTrace(1, "Went wrong in Show Browser {0}", ex.Message); } }
/// <summary> /// 开始播放课程 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnPlayCourse(object sender, RoutedEventArgs e) { TreeViewItem tvi = (TreeViewItem)sender; Hashtable tmp = (Hashtable)tvi.Tag; host.Dispose(); shockwave.Dispose(); host = new System.Windows.Forms.Integration.WindowsFormsHost(); shockwave = new AxShockwaveFlashObjects.AxShockwaveFlash(); host.Child = shockwave; //this.playerPanel.Children.Add(host); // 设置 .swf 文件相对路径 string swfPath = System.Environment.CurrentDirectory; swfPath += "\\Course\\" + tmp["mid"] + "-" + tmp["cid"] + ".swf"; shockwave.Movie = swfPath; shockwave.FlashCall += new AxShockwaveFlashObjects._IShockwaveFlashEvents_FlashCallEventHandler(FromFlashCall); shockwave.CallFunction("<invoke name=\"c2flash\" returntype=\"xml\"><arguments><number>50</number></arguments></invoke>"); // this.changeVolume.Value = 50; shockwave.Loop = false; //this.changeVolume.ValueChanged += changeVolume_ValueChanged; cdb.OnUpCourseLook(tmp); // MessageBox.Show("开始。。。"); }
public GanttViewer(Project project) { InitializeComponent(); System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); //Set the new WFH object equal to a new gantt chart of selected project host.Child = Gantt.returnGantt(project); if (host.Child != null) { // Add the chart to the grid so it can be displayed. wfhGantt.Child = host.Child; //Bind the MouseMove and MouseClick handler wfhGantt.Child.MouseMove += Child_MouseMove; wfhGantt.Child.MouseClick += Child_MouseClick; Background = UI.leftBorderColor; this.Show(); } else { System.Windows.MessageBox.Show("Error loading Gantt chart - make sure you are in 'Task' view!"); } }
private static IRenderHost CreateWindowWpf(Size size, string title, Func <IRenderHostSetup, IRenderHost> constructorForRenderHost) { var window = new System.Windows.Window() { Width = size.Width, Height = size.Height, Title = title }; var hostControl = CreateHostControl(); // create forms host which is basically a wrapper for the WPF to function properly var windowsFormsHost = new System.Windows.Forms.Integration.WindowsFormsHost() { Child = hostControl, // Here, if need be, you can add necessary properties for the WPF //Width = 300, //Height = 200, //HorizontalAlignment = System.Windows.HorizontalAlignment.Left, //VerticalAlignment = System.Windows.VerticalAlignment.Top, //Margin = new System.Windows.Thickness(200, 100, 0, 0) }; window.Content = windowsFormsHost; window.Closed += (sender, args) => System.Windows.Application.Current.Shutdown(); window.Show(); var renderHostSetup = new RenderHostSetup(hostControl.Handle(), new Inputs.InputForms(hostControl)); // TODO: change default to IInput var renderHostToReturn = constructorForRenderHost(renderHostSetup); return(renderHostToReturn); }
private void Child_MouseClick(object sender, Forms.MouseEventArgs e) { //Remove any old event handlers to save a lot of memory wfhTest.Child.MouseMove -= Child_MouseMove; wfhTest.Child.MouseClick -= Child_MouseClick; //Cast chart object to the child of windows forms host to generate an object for the current chart Chart currChart = (Chart)wfhTest.Child; Forms.Integration.WindowsFormsHost host = new Forms.Integration.WindowsFormsHost(); //Generate the new chart (do we have to generate the task chart or project chart (or stay the same) Chart newChart = ModelView.manageBarClicking(currChart.HitTest(e.X, e.Y), currChart); //If no DP was clicked ModelView.manageBarClicking returns the same chart if (newChart != currChart) { if (newChart != null) { // Add the chart to the Windows Form Host. host.Child = newChart; // Add the chart to the grid so it can be displayed. wfhTest.Child = host.Child; //Bind the MouseMove and MouseClick handler } else { MessageBox.Show("No tasks found"); } } //Add new event handlers (this is why it was important to remove the old ones, they still take up space - a lot of it - and do not work when the child is modified) wfhTest.Child.MouseMove += Child_MouseMove; wfhTest.Child.MouseClick += Child_MouseClick; }
private void refresh() { //Show the please wait screen and hide other boxes/buttons/etc introLabel.Visibility = Visibility.Collapsed; wfhTest.Visibility = Visibility.Visible; PleaseWait plsw = new PleaseWait(); plsw.Show(); Forms.Integration.WindowsFormsHost host = new Forms.Integration.WindowsFormsHost(); // Add the chart to the Windows Form Host. ModelView.populateProjects(LoginHandler.username); host.Child = ModelView.projectChartGenerator("Project List", "Time Left (Hours)"); // Add the chart to the grid so it can be displayed. wfhTest.Child = host.Child; //Bind the MouseMove and MouseClick handler wfhTest.Child.MouseMove += Child_MouseMove; wfhTest.Child.MouseClick += Child_MouseClick; //Generate tasks for the projectlist ModelView.generateTaskCharts("Task Name", "Hours Left"); plsw.Close(); }
private AxMxDrawXLib.AxMxDrawX axMxDrawX = new AxMxDrawXLib.AxMxDrawX();//MxDraw插件 public PageProduceProce() { InitializeComponent(); MxDrawXLib.MxDrawApplication app = new MxDrawXLib.MxDrawApplication(); app.InitMxDrawOcx("", "湖北洪城通用机械股份有限公司", "湖北洪城通用机械股份有限公司MES系统", "18971438760", "010ADE5E0DA2A305784A00001C220CA8320E5B4BFBEAD6B3AC5926EDF3E53A46B314A88852C4DCDE3DECF60325710000070A796586FBEA03F9720000242A0EC1C00B65A20465E37C87F062B8CD76CF30A2C4C5C3553DA823D5795527F89D18F0BDC04AA73C190000262A91655C85AC1354C3859CDC2C0E84B81418DB4CE1E8E909AA2C2EDB1E6ECB86F3657BCE0345533AF70000232A0CA8320E5B4BFBEAD6B3AC5926EDF3E53A46B314A88852C43C26D984C0A4C1F5AB63AFDFB544A59200000B12CBAB9FF17B61A88DCCFB24112739F7860000080A102C07683817AE710000"); ((System.ComponentModel.ISupportInitialize)axMxDrawX).BeginInit(); System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost() { Child = axMxDrawX }; ((System.ComponentModel.ISupportInitialize)axMxDrawX).EndInit(); axMxDrawX.ShowCommandWindow = false; axMxDrawX.ShowModelBar = false; axMxDrawX.ShowStatusBar = false; axMxDrawX.ShowToolBars = false; axMxDrawX.Padding = new System.Windows.Forms.Padding(0); axMxDrawX.Margin = new System.Windows.Forms.Padding(0); axMxDrawX.IsFirstRunPan = true; axMxDrawX.IsDrawCoord = false; axMxDrawX.Iniset = "DisplayPrecision=999"; //axMxDrawX.UserName = "******"; //axMxDrawX.UserPhone = "18971438760"; //axMxDrawX.UserData = "010ADE5E0DA2A305784A00001C220CA8320E5B4BFBEAD6B3AC5926EDF3E53A46B314A88852C4DCDE3DECF60325710000070A796586FBEA03F9720000242A0EC1C00B65A20465E37C87F062B8CD76CF30A2C4C5C3553DA823D5795527F89D18F0BDC04AA73C190000262A91655C85AC1354C3859CDC2C0E84B81418DB4CE1E8E909AA2C2EDB1E6ECB86F3657BCE0345533AF70000232A0CA8320E5B4BFBEAD6B3AC5926EDF3E53A46B314A88852C43C26D984C0A4C1F5AB63AFDFB544A59200000B12CBAB9FF17B61A88DCCFB24112739F7860000080A102C07683817AE710000"; //axMxDrawX.UserSoftwareName = "湖北洪城通用机械股份有限公司MES系统"; mxDraw.Children.Add(host); DataContext = new ProduceProceViewModel(axMxDrawX); }
private void btn_baidu_login_Click(object sender, RoutedEventArgs a) { var b = new System.Windows.Forms.WebBrowser(); b.Width = 800; b.Height = 600; b.AllowNavigation = true; var w = new System.Windows.Window(); b.Navigated += (s, e) => { try { var m = new Regex("access_token=(.*?)&").Match(e.Url.ToString()); if (m.Success) { Global.AppSettings["baidu_access_token"] = m.Groups[1].Value; w.Close(); } else { } } catch (Exception ex) { Logger.Error(ex); } }; b.Navigate(new PCS_client().GetAccessTokenPage()); var h = new System.Windows.Forms.Integration.WindowsFormsHost(); h.Child = b; w.Content = h; w.ShowDialog(); }
private void MapControl_Initialized(object sender, EventArgs e) { // Create the interop host control. System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); axMap1 = new AxMapWinGIS.AxMap(); host.Child = axMap1; new GlobalSettings() { BingApiKey = "AimcXg9FM3tvlLlm3DJlO7kw_8QRFCJI5BkRA0IWJQP-Y5wtZJGJw81C-YuTcMMF" }; string localData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); //new GlobalSettings().StartLogTileRequests(localData + @"\ResTBDesktop\tiles.txt"); new GlobalSettings().AllowLayersWithoutProjections = true; new GlobalSettings().AllowLayersWithIncompleteReprojection = true; new GlobalSettings().ReprojectLayersOnAdding = true; this.ResTBMap.Children.Add(host); _tools = new MapControlTools(axMap1); }
//The function loads the <H chart private void cnvChartPha_Loaded(object sender, RoutedEventArgs e) { System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); host.Child = chtPha; // Add the chart to the canvas so it can be displayed. this.cnvChartPha.Children.Add(host); }
private void Window_Loaded(object sender, RoutedEventArgs e) { // Create the interop host control. System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); AnyCAD.Presentation.RenderWindow3d renderView = new AnyCAD.Presentation.RenderWindow3d(); host.Child = renderView; this.grid3d.Children.Add(host); }
public WPFPreviewControl() { this.HorizontalAlignment = HorizontalAlignment.Stretch; this.VerticalAlignment = VerticalAlignment.Stretch; this.Unloaded += new RoutedEventHandler(WPFPreviewControl_Unloaded); host = new System.Windows.Forms.Integration.WindowsFormsHost(); host.Child = new System.Windows.Forms.Panel(); host.Loaded += new RoutedEventHandler(host_Loaded); this.Content = host; }
private void IntializeChromeBrowser() { System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); browser = new CefWebBrowser(); browser.Dock = System.Windows.Forms.DockStyle.Fill; host.Child = browser; browser.StartUrl = "http://www.google.com"; Grid1.Children.Add(host); }
private void _query_Click(object sender, RoutedEventArgs e) { if (page_url != "") { //_webBrowser.Source = new Uri(string.Format(page_url, user_id, "2", (_month.SelectedIndex + 1).ToString(), _year.Text)); System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); web = new System.Windows.Forms.WebBrowser(); web.Url = new Uri(string.Format(page_url, user_id, "2", (_month.SelectedIndex + 1).ToString(), _year.Text)); host.Child = web; grid_info.Children.Add(host); } }
private void _query_Click(object sender, RoutedEventArgs e) { if (page_url != "") { //_webBrowser.Source = new Uri(string.Format(page_url, user_id, "2", (_month.SelectedIndex + 1).ToString(), _year.Text)); System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); web = new System.Windows.Forms.WebBrowser(); web.ScriptErrorsSuppressed = true; web.Url = new Uri(string.Format(page_url, user_id, "2", (_month.SelectedIndex + 1).ToString(), _year.Text, _detect_huanjie.SelectedIndex < 1 ? "" : (_detect_huanjie.SelectedItem as Label).Tag)); host.Child = web; grid_info.Children.Add(host); } }
private void Grid_Loaded(object sender, RoutedEventArgs e) { t.Interval = ((VizitorData)DataContext).Interval; t.Tick += T_Tick; t.Enabled = true; System.Windows.Forms.Integration.WindowsFormsHost h = new System.Windows.Forms.Integration.WindowsFormsHost(); wb = new System.Windows.Forms.WebBrowser(); h.Child = wb; host.Children.Add(h); wb.ScriptErrorsSuppressed = true; wb.DocumentCompleted += Wb_DocumentCompleted; ; wb.Navigate(((VizitorData)DataContext).Url); }
public ListMapLayerOptionsWindow(MapLayerOptionListData optionListData) { InitializeComponent(); this._optionListData = optionListData; this.HeadingTB.Text = this._optionListData.Opening; this.OptionLB.ItemsSource = this._optionListData.Options; this._selectedItems = new List<MapLayerOptionItemData>(); System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); // Create an object of the map control. this._axMapCtrl = new AxMapControl(); host.Child = this._axMapCtrl; this.mapGrid.Children.Add(host); }
public void Initialize() { // Create an object of the symbology control. System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); // Create an object of the map control. this._axSymCtrl = new AxSymbologyControl(); this._axSymCtrl.BeginInit(); host.Child = this._axSymCtrl; this.SymbolCtrlGrid.Children.Add(host); this._axSymCtrl.OnItemSelected += new ESRI.ArcGIS.Controls.ISymbologyControlEvents_Ax_OnItemSelectedEventHandler(this.axSymCtrl_OnItemSelected); this._axSymCtrl.EndInit(); this.LoadStyleFile(); }
public EditArticleAppearanceWindow(ObservableCollection<Profile> profiles) { InitializeComponent(); this.profiles = profiles; this.AllowsTransparency = false; cmbProfile.ItemsSource = profiles; foreach (Profile p in profiles) if (p.IsPrimary) cmbProfile.SelectedItem = p; System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); host.Background = new BrushConverter().ConvertFromString("#efeff2") as SolidColorBrush; host.Child = pnlButtons; this.WinFormsArea.Children.Add(host); }
private void WindowLoaded(object sender, RoutedEventArgs e) { // Create the interop host control. System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); // Create the MaskedTextBox control. MaskedTextBox mtbDate = new MaskedTextBox("00/00/0000"); // Assign the MaskedTextBox control as the host control's child. host.Child = mtbDate; // Add the interop host control to the Grid // control's collection of child controls. this.grid1.Children.Add(host); }
void OnLoaded(object sender, RoutedEventArgs e) { var formsHost = new System.Windows.Forms.Integration.WindowsFormsHost { Child = _propertyGrid }; FormsHostContainer.Child = formsHost; StatusText.Text = string.Format(CultureInfo.InvariantCulture, "Executing serialization performance test..."); // A different data type can be swapped for Employee to measure // performance on it. Templated because some of the serializers // have only templated deserializer methods. var i = Employee.JamesTKirk; var c = new Collection<SerializerTest<Employee>> { new ProtobufSerializerTest<Employee>(i, Iterations), new XmlDataContractSerializerTest<Employee>(i, Iterations), new JsonDataContractSerializerTest<Employee>(i, Iterations), new JsonNewtonsoftSerializerTest<Employee>(i, Iterations), new XmlSerializerTest<Employee>(i, Iterations), new BinaryFormatterSerializerTest<Employee>(i, Iterations) }; /* var i = TelemetryLog.SampleData; var c = new Collection<SerializerTest<TelemetryLog>> { new ProtobufSerializerTest<TelemetryLog>(i, Iterations), new XmlDataContractSerializerTest<TelemetryLog>(i, Iterations), new JsonDataContractSerializerTest<TelemetryLog>(i, Iterations), new JsonNewtonsoftSerializerTest<TelemetryLog>(i, Iterations), new XmlSerializerTest<TelemetryLog>(i, Iterations), new BinaryFormatterSerializerTest<TelemetryLog>(i, Iterations) }; */ foreach (var test in c) { test.Execute(); } DataGrid.ItemsSource = c; DataGrid.SelectedIndex = 0; StatusText.Text = string.Format(CultureInfo.InvariantCulture, "{0} iterations of type {1} executed.", Iterations, c[0].ClassName); }
public AuthorizationWindow(string clientId, string redirectUrl, string scope, bool logOutFirst = true) { InitializeComponent(); initialLogoutCompleted = !logOutFirst; Guid guid = System.Guid.NewGuid(); state = guid.ToString(); System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); webBrowserAuthorization = new System.Windows.Forms.WebBrowser(); host.Child = webBrowserAuthorization; this.mainGrid.Children.Add(host); webBrowserAuthorization.LocationChanged += webBrowserAuthorization_LocationChanged; webBrowserAuthorization.Navigating += webBrowserAuthorization_Navigating; webBrowserAuthorization.Navigated += webBrowserAuthorization_Navigated; authUrl = string.Format("https://account.app.net/oauth/authenticate?client_id={0}&response_type=token&redirect_uri={1}&scope={2}&state={3}", System.Web.HttpUtility.UrlEncode(clientId), System.Web.HttpUtility.UrlEncode(redirectUrl), System.Web.HttpUtility.UrlEncode(scope), System.Web.HttpUtility.UrlEncode(state)); }
public Authentication_window(string clientId, string clientSecret, string redirectUrl, string scope = "https://api.screenname.aol.com/auth/authorize ", string response_type = "code", bool logOutFirst = false, string state = null) { InitializeComponent(); initialLogoutCompleted = !logOutFirst; Guid guid = System.Guid.NewGuid(); state = guid.ToString(); client_id = clientId; client_secret = clientSecret; redirect_uri = redirectUrl; System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); webBrowserAuthorization = new System.Windows.Forms.WebBrowser(); host.Child = webBrowserAuthorization; this.mainGrid.Children.Add(host); webBrowserAuthorization.Navigated += webBrowserAuthorization_Navigated; webBrowserAuthorization.Navigating += webBrowserAuthorization_Navigating; authUrl = Authentications.get_authentication_url(response_type: response_type, client_id: clientId, redirect_uri: redirectUrl, scope: scope, state: state); }
protected override void OnInitialized(EventArgs e) { base.OnInitialized(e); RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); RowDefinitions.Add(new RowDefinition()); Children.Add(titleLabel); propertyGrid = new System.Windows.Forms.PropertyGrid { ToolbarVisible = false, LargeButtons = true }; propertyGrid.PropertyValueChanged += PropertyGrid_PropertyValueChanged; host = new System.Windows.Forms.Integration.WindowsFormsHost { Child = propertyGrid }; Children.Add(host); Grid.SetRow(host, 1); Update(); }
private void WindowLoaded(object sender, RoutedEventArgs e) { // Comment out the following line to disable visual // styles for the hosted Windows Forms control. System.Windows.Forms.Application.EnableVisualStyles(); // Create a WindowsFormsHost element to host // the Windows Forms control. System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); // Create a Windows Forms tab control. System.Windows.Forms.TabControl tc = new System.Windows.Forms.TabControl(); tc.TabPages.Add("Tab1"); tc.TabPages.Add("Tab2"); // Assign the Windows Forms tab control as the hosted control. host.Child = tc; // Assign the host element to the parent Grid element. this.grid1.Children.Add(host); }
//int CurrentUser = Convert.ToInt32(c1); private void Window_Loaded(object sender, RoutedEventArgs e) { // 创建 host 对象 System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); // 实例化 axShockwaveFlash1 AxShockwaveFlashObjects.AxShockwaveFlash axShockwaveFlash1 = new AxShockwaveFlashObjects.AxShockwaveFlash(); // 装载.axShockwaveFlash1 host.Child = axShockwaveFlash1; // 将 host 对象嵌入FlashGrid this.FlashGrid.Children.Add(host); // 设置 .swf 文件相对路径 string swfPath = System.Environment.CurrentDirectory; swfPath += @"\1.swf"; axShockwaveFlash1.Movie = swfPath; label1.Visibility = System.Windows.Visibility.Hidden; label5.Visibility = System.Windows.Visibility.Hidden; startKinect(); //kinectSensorChooser1.KinectSensorChanged += new DependencyPropertyChangedEventHandler(kinectSensorChooser1_KinectSensorChanged); }
private void DiversityPage_Loaded(object sender, RoutedEventArgs e) { tvFinalSelection.ImageList = OptionsAccess.TreeviewIcons; ProgressInformationWindow piw = new ProgressInformationWindow(); piw.DataContext = FieldDataManager.SelectionBuilder.Progress; FieldDataManager.SelectionBuilder.finishSelection(); piw.ShowDialog(); var host = new System.Windows.Forms.Integration.WindowsFormsHost(); host.Child = tvFinalSelection; containerTreeviewFinalSelection.Children.Clear(); containerTreeviewFinalSelection.Children.Add(host); }
private void ListfileWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { FilterBox.Visibility = Visibility.Visible; tabs.Visibility = Visibility.Visible; ModelListBox.Visibility = Visibility.Visible; MapsTab.Visibility = Visibility.Visible; progressBar.Value = 100; progressLabel.Content = "Done."; ModelListBox.DataContext = models; ModelListBox.Items.SortDescriptions.Add(new SortDescription("", ListSortDirection.Ascending)); winFormControl = wfContainer; }
private void Window_Loaded(object sedner, RoutedEventArgs e) { System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); }
private void CreateGEM() { App.Current.Dispatcher.Invoke( new Action(delegate { _win = new Window(); _win.Initialized += delegate { _host = new System.Windows.Forms.Integration.WindowsFormsHost(); _win.Content = _host; _gem = new AxEZGEMLib.AxEZGEM(); _host.Child = GEM; IsLoaded = true; }; _win.Loaded += delegate { }; _win.WindowStyle = WindowStyle.ToolWindow; _win.WindowState = WindowState.Minimized; _win.Show(); }), null); }
private void Window_Loaded(object sender, RoutedEventArgs e) { controls = new ControlsWindow(); controls.Show(); winFormControl = wfContainer; cascProgressBar = CASCprogress; cascProgressDesc = CASCdesc; useCASC = true; if (!CASCinitialized) { SwitchToCASC(); } }
private void LoadTrackStatusObject() { this.axTetTrackStatus = new AxTetComp.AxTetTrackStatus(); this.axTetTrackStatus.Enabled = true; this.axTetTrackStatus.Name = "axTetTrackStatus"; this.axTetTrackStatus.OcxState = ((System.Windows.Forms.AxHost.State)(Resources.FindName("axTetTrackStatus.OcxState"))); //used to host System.Windows.Forms control in WPF System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); host.Child = axTetTrackStatus; //add the trackstatus window to the host host.Width = 120; //Size of the host controls the size of the control host.Height = 70; Canvas.SetBottom(host, 5); //position the host on Canvas_TrackStatus Canvas.SetRight(host, 10); //this.Canvas_TrackStatus.Children.Add(host); // add the host to the track status canvas _hitCanvas.Children.Add(host); // Retreive underlying references to ActiveX controls tetTrackStatus = (ITetTrackStatus)axTetTrackStatus.GetOcx(); //*** try to contect to the server try { // Connect to the TET server if necessary if (!tetTrackStatus.IsConnected) tetTrackStatus.Connect("193.167.42.30", (int)TetConstants.TetConstants_DefaultServerPort); // Start the track status meter if (!tetTrackStatus.IsTracking) tetTrackStatus.Start(); //Connect to the TET Client if necessary if (!tetClient.IsConnected) { tetClient.Connect("193.167.42.30", (int)TetConstants.TetConstants_DefaultServerPort, TetSynchronizationMode.TetSynchronizationMode_Server); } tetClient.StartTracking();//Start tracking } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
/// <summary> /// Emotion ZedGraph init /// </summary> private void EmotionGraphInit() { System.Windows.Forms.Integration.WindowsFormsHost emotionHost = new System.Windows.Forms.Integration.WindowsFormsHost(); emotionZedGraph = new ZedGraph.ZedGraphControl(); emotionZedGraph.IsEnableZoom = false; emotionHost.Child = emotionZedGraph; EmotionGrid.Children.Add(emotionHost); emotionGraph = new BasicDSP.Graph(emotionZedGraph.CreateGraphics(), emotionZedGraph); emotionGraphPane = emotionZedGraph.GraphPane; emotionLine = new ZedGraph.LineObj(System.Drawing.Color.Red, graphLineXPosition, emotionGraphPane.YAxis.Scale.Min, graphLineXPosition, emotionGraphPane.YAxis.Scale.Max); emotionLine.Line.Width = 1f; emotionGraphPane.GraphObjList.Add(emotionLine); EmotionZedGraphRefresh(); }
/// <summary> /// EEG ZedGraph init /// </summary> private void EEGGraphInit() { System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); eegZedGraph = new ZedGraph.ZedGraphControl(); eegZedGraph.IsEnableZoom = false; // http://goorman.free.fr/ZedGraph/zedgraph.org/wiki/indexa9f9.html?title=Edit_Points_by_Dragging_the_Mouse //zedGraph.MouseDownEvent += zedGraph_MouseDownEvent; host.Child = eegZedGraph; EEGGrid.Children.Add(host); eegGraph = new BasicDSP.Graph(eegZedGraph.CreateGraphics(), eegZedGraph); zedGraphPane = eegZedGraph.GraphPane; eegLine = new ZedGraph.LineObj(System.Drawing.Color.Red, graphLineXPosition, zedGraphPane.YAxis.Scale.Min, graphLineXPosition, zedGraphPane.YAxis.Scale.Max); eegLine.Line.Width = 1f; zedGraphPane.GraphObjList.Add(eegLine); EEGZedGraphRefresh(); }
/// <summary> /// Activity ZedGraph init /// </summary> private void ActivityGraphInit() { System.Windows.Forms.Integration.WindowsFormsHost activityHost = new System.Windows.Forms.Integration.WindowsFormsHost(); activityZedGraph = new ZedGraph.ZedGraphControl(); activityZedGraph.IsEnableZoom = false; activityHost.Child = activityZedGraph; ActivityGrid.Children.Add(activityHost); activityGraph = new BasicDSP.Graph(activityZedGraph.CreateGraphics(), activityZedGraph); activityGraphPane = activityZedGraph.GraphPane; activityLine = new ZedGraph.LineObj(System.Drawing.Color.Red, graphLineXPosition, activityGraphPane.YAxis.Scale.Min, graphLineXPosition, activityGraphPane.YAxis.Scale.Max); activityLine.Line.Width = 1f; activityGraphPane.GraphObjList.Add(activityLine); ActivityZedGraphRefresh(); }
/// <summary> /// Init spectrum ZedGraph /// </summary> private void SpectrumGraphInit() { System.Windows.Forms.Integration.WindowsFormsHost spectrumZedGraphHost = new System.Windows.Forms.Integration.WindowsFormsHost(); spectrumZedGraph = new ZedGraph.ZedGraphControl(); spectrumZedGraph.IsEnableZoom = false; spectrumZedGraphHost.Child = spectrumZedGraph; SpectrumGrid.Children.Add(spectrumZedGraphHost); spectrumGraph = new BasicDSP.Graph(spectrumZedGraph.CreateGraphics(), spectrumZedGraph); spectrumGraphPane = spectrumZedGraph.GraphPane; SpectrumZedGraphRefresh(); }
private void PageUnloaded(object sender, RoutedEventArgs e) { this.Stage.Children.Remove(host); pdfviewer.Dispose(); pdfviewer = null; host.Dispose(); host = null; }