Esempio n. 1
0
		public HtmlViewControl(bool showNavigation)
		{
			Dock = DockStyle.Fill;
			Size = new Size(500, 500);
			
			if (showNavigation) 
			{
				
				//				urlTextBox.Location  = new Point(0, 26);
				//				urlTextBox.Size      = new Size(Width, 24);
				urlTextBox.KeyPress += new KeyPressEventHandler(KeyPressEvent);
				
				Controls.Add(urlTextBox);
				urlTextBox.Dock = DockStyle.Top;

				for (int i = 0; i < 4; ++i) 
				{
					ToolBarButton toolBarButton = new ToolBarButton();
					toolBarButton.ImageIndex    = i;
					toolBar.Buttons.Add(toolBarButton);
				}
				
				ResourceService ResourceService = (ResourceService)ServiceManager.Services.GetService(typeof(ResourceService));
				toolBar.ImageList = new ImageList();
				toolBar.ImageList.Images.Add(ResourceService.GetBitmap("Icons.16x16.BrowserBefore"));
				toolBar.ImageList.Images.Add(ResourceService.GetBitmap("Icons.16x16.BrowserAfter"));
				toolBar.ImageList.Images.Add(ResourceService.GetBitmap("Icons.16x16.BrowserCancel"));
				toolBar.ImageList.Images.Add(ResourceService.GetBitmap("Icons.16x16.BrowserRefresh"));
				
				toolBar.Appearance = ToolBarAppearance.Flat;
				toolBar.Dock = DockStyle.Top;
				toolBar.ButtonClick += new ToolBarButtonClickEventHandler(ToolBarClick);
				
				Controls.Add(toolBar);
			} 
			
			axWebBrowser = new AxWebBrowser();
			axWebBrowser.BeginInit();
			if (showNavigation) 
			{
				int height = 48;
				axWebBrowser.Location = new Point(0, height);
				axWebBrowser.Size     = new Size(Width, Height - height); 
				axWebBrowser.Anchor   = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Top;
			} 
			else 
			{
				axWebBrowser.Dock = DockStyle.Fill;
			}
			axWebBrowser.HandleCreated += new EventHandler(this.CreatedWebBrowserHandle);
			axWebBrowser.TitleChange   += new DWebBrowserEvents2_TitleChangeEventHandler(TitleChange);
			
			Controls.Add(axWebBrowser);
			axWebBrowser.EndInit();
		}
Esempio n. 2
0
		public AxWebBrowserEventMulticaster(AxWebBrowser parent) 
		{
			this.parent = parent;
		}