Example #1
0
        public HyperlinkLabel(Links news)
        {
            this.AutoSize = true;

            // Configure the appearance.
            // Set the DisabledLinkColor so that a disabled link will show up against the form's background.
            this.DisabledLinkColor = System.Drawing.Color.Red;
            this.VisitedLinkColor = System.Drawing.Color.Blue;
            this.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
            this.LinkColor = System.Drawing.Color.Navy;

            // Add an event handler to do something when the links are clicked.
            //this.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);

            // Identify that the first link is visited already.
            this.Links[0].Visited = true;

            // Set the Text property to a string.
            this.Text = news.Title;

            this.Links[0].LinkData = news.URL;
            //  The second link is disabled and will appear as red.
            this.Links[0].Enabled = true;
        }
Example #2
0
        private void MainDialog_Load(object sender, EventArgs e)
        {
            DialogLogin loginDlg = new DialogLogin();
            loginDlg.SettingConfigs = m_SettingConfigs;

            if (loginDlg.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                Environment.Exit(0);
            }
            this.Text = getCaption(loginDlg.apiSection.ApiElement.AppID);
            if (m_StockConfigs.load())
            {
                foreach (KeyValuePair<string, string> kvce in m_StockConfigs.appConfigs)
                {
                    SmpStock stock = new SmpStock(kvce.Key, kvce.Value);
                    stock.Checked = true;
                    lst_Stocks.Add(stock);
                }
            }
            if (m_NewsConfigs.load())
            {
                foreach (KeyValuePair<string, string> kvce in m_NewsConfigs.appConfigs)
                {
                    Links theNews = new Links(kvce.Key, kvce.Value);
                    lst_News.Add(theNews);
                }
            }
            m_NewsPanel = new NewsPanel(lst_News);
            TabPage_News.Controls.Add(m_NewsPanel);

            m_StockPanel.InitData(lst_Stocks);

            m_UpdateTimer.Interval = 1000;
            m_UpdateTimer.Enabled = true;
            m_UpdateTimer.Tick += new EventHandler(UpdateTimer_Tick_EventHandler);
            m_UpdateTimer.Start();

            m_SecondTimer.Interval = 1000;
            m_SecondTimer.Enabled = true;
            m_SecondTimer.Tick += new EventHandler(SecondTimer_Tick_EventHandler);
            m_SecondTimer.Start();

            CfgManager.ReadConnectionStrings();
            CfgManager.MapMachineConfiguration();
            SNTPTime.calibrationTime();

            m_HandleShowApi.BgWorkerCompleted += new EventHandler<BgWorkerEventArgs>(HandleShowApi_BgWorkerCompleted);
        }