Exemplo n.º 1
0
        public SQLForm()
        {
            InitializeComponent();
            refreshCounter = refreshSQLCount;
            cTextScroll = new TextSroll(this);
            strSQlCon = "user id=" + TriggerForm.SQLUser +      //linedata;" +
                        ";password="******" +
                        ";server=" + TriggerForm.SQLServer +     //HYG-CPS001;" +
                        ";Trusted_Connection=no;" +
                        "database=1982_PG_Csiomor; " +
                        "connection timeout=20";

            Thread SQLDataConnectionThread = new Thread(new ThreadStart(SQLDataConnection));
            SQLDataConnectionThread.IsBackground = true;
            SQLDataConnectionThread.Name = "SQL DataConnection Thread";
            SQLDataConnectionThread.Start();
            ShowStartLabel();
        }
Exemplo n.º 2
0
 public void CalculateDisplayTextHeight(TextSroll.DisplayText item, int yCorrection = 0)
 {
     Graphics grfx = parent.CreateGraphics();
     item.TextHeight = (int)grfx.MeasureString(item.TextString, item.TextFont).Height + yCorrection;
 }
Exemplo n.º 3
0
 public void CalculateDisplayTextWidth(TextSroll.DisplayText item, int xCorrection = 0)
 {
     Graphics grfx = parent.CreateGraphics();
     item.TextWidth = (int)grfx.MeasureString(item.TextString, item.TextFont).Width + xCorrection;
 }
Exemplo n.º 4
0
        private void SQLDataToDisplaytext(ref TextSroll.DisplayText[] returnArrDisptext)
        {
            if (SQLDisplay.ErrorCode < 0)   // If NO Error
            {
                returnArrDisptext = new TextSroll.DisplayText[SQLDisplay.strDescription.Count() * 2];

                int c = 0;
                for (int i = 0; i < SQLDisplay.strDescription.Count(); i++)
                {
                    returnArrDisptext[c] = cTextScroll.AddNewDispText(Desc[i]);
                    returnArrDisptext[c].TextWidth = returnArrDisptext[c].TextWidth - 10;
                    //disptext[c].TextString = SQLDisplay.strDescription[i]+":";//.Substring(0,1); */
                    c++;

                    returnArrDisptext[c] = cTextScroll.AddNewDispText(SQLDisplay.strData[i]);
                    returnArrDisptext[c].TextWidth = returnArrDisptext[c].TextWidth + 70;

                    c++;
                }
                cTextScroll.YPos = 0;
                returnArrDisptext[5].TextBackColor = intProducedBox < intTargetBoxNR ? null : Brushes.DarkGoldenrod;
                //ShowText(SQLDisplay.strDescription[intActColumn] + ": " + SQLDisplay.strData[intActColumn], (int)fontsize.big);
            }
            else                            // On Error
            {
                returnArrDisptext = new TextSroll.DisplayText[2];
                returnArrDisptext[0] = cTextScroll.AddNewDispText(SQLDisplay.strTrace);
                returnArrDisptext[1] = cTextScroll.AddNewDispText(SQLDisplay.strError);
                for (int i = 0; i < 2; i++)
                {
                    returnArrDisptext[i].TextFont = new System.Drawing.Font("Microsoft Sans Serif", 18, FontStyle.Bold);
                    cTextScroll.CalculateDisplayTextWidth(returnArrDisptext[i], 50);
                    cTextScroll.CalculateDisplayTextHeight(returnArrDisptext[i]);
                }

                cTextScroll.YPos = this.Height/2 - returnArrDisptext[0].TextHeight/2;
                //ShowText(SQLDisplay.error, (int)fontsize.small, FontStyle.Regular);
            }
        }