Пример #1
0
        private void LoadFavouriteTools()
        {
            Favourites favs = new Favourites();

            favs.LoadFavTable();
            DataRowCollection rc = favs.GetFavs();

            foreach (DataRow r in rc)
            {
                ToolStripItem tItem = new ToolStripButton();
                tItem.Tag          = r[0].ToString();
                tItem.Text         = "";
                tItem.ToolTipText  = r[0].ToString();
                tItem.ImageScaling = ToolStripItemImageScaling.None;
                Bitmap ico = favs.BytesToBitmap((byte[])r[2]);
                tItem.Image  = ico;
                tItem.Click += TItem_Click;
                mainTools.Items.Add(tItem);
            }
        }
Пример #2
0
        public web_view(Blinkki window, string url, bool hideTools = true)
        {
            this.url = url;
            this.frm = window;

            InitializeComponent();

            this.txtToolUrl.KeyUp       += new System.Windows.Forms.KeyEventHandler(this.txtToolUrl_KeyUp);
            this.txtToolUrl.MouseUp     += new System.Windows.Forms.MouseEventHandler(this.txtToolUrl_MouseUp);
            this.txtToolUrl.TextChanged += new System.EventHandler(this.txtToolUrl_TextChanged);
            this.txtToolUrl.Leave       += TxtToolUrl_Leave;

            this.browserTools.Visible = hideTools;
            if (!Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute) && !url.Contains("/fav.html"))
            {
                this.url = "https://www.google.com/?gws_rd=ssl#q=" + Uri.EscapeDataString(url);
            }
            this.Text  = url;
            this.title = url;

            browserTools.Renderer = new MainFormToolStripRenderer();
            favs.LoadFavTable();
            btnFav.DropDownItemClicked += new ToolStripItemClickedEventHandler(btnFav_DropDownItemClicked);
        }