sexta-feira, 18 de junho de 2021

C# - Marcando ocorrências de múltiplos


A primeira versão deste programa,
foi criada em C++ com o Qt,
e me lembro que me deu bastante trabalho,
porque não é simplesmente pesquisar
os múltiplos, se fosse só isto seria muito fácil,
mas o que agente queria mesmo era marcar
as ocorrências usando um bitimap como fundo;
Depois de várias cabeçadas nós conseguimos,
e depois criemos outra versão no C++ Builder,
ainda em C++, e agora aproveitando um pouco
do tempo que nos sobrou fizemos o mesmo programa
em C# usando o VS Studio da microsoft. 
Veja no vídeo ele funcionando.




        /*============================================================*/
        void Informe ( PaintEventArgs e ) {
            Graphics dc = e.Graphics;
            Font myFont = new System.Drawing.Font ( "Helvetica"11,
                FontStyle.Italic );
            Brush myBrush_1 = new SolidBrush ( System.Drawing.Color.Red );
            Brush myBrush_2 = new SolidBrush ( System.Drawing.Color.Blue );
            Brush myBrush_3 = new SolidBrush ( System.Drawing.Color.Black );
            dc.DrawString ( "Por: "myFontmyBrush_1350300 );
            dc.DrawString ( "Samuel Lima "myFontmyBrush_2380300 );
            dc.DrawString ( "sa_sp10@hotmail.com "myFontmyBrush_3350315 );
        }
        /*============================================================*/
        private void Paint_Imagem ( PaintEventArgs e ) {
            Image newImage = Image.FromFile ( "Moldura_7.bmp" );
            Point ulCorner = new Point ( 00 );
            e.Graphics.DrawImage ( newImageulCorner );
        }
        /*============================================================*/
        protected override void OnPaint ( PaintEventArgs e ) {
            Paint_Imagem ( e );
            this.Size = new System.Drawing.Size ( 615379 );
            this.Text = "C# - MÚLTIPLOS MARCANDO OCORRÊNCIAS";
            this.BackColor = Color.White;
            Graphics dc = e.Graphics;
            Font myFont = new System.Drawing.Font ( "Consolas"12,
                FontStyle.Italic );
            Brush myBrush_1 = new SolidBrush ( Color.Red );
            dc.DrawString ( "C# - MÚLTIPLOS MARCANDO OCORRÊNCIAS",
                myFontmyBrush_113015 );
            Informe ( e );
        }
        /*============================================================*/
        void FlowLayoutPanel_1 ( int Xint Yint Wint H ) {
            flowLayoutPanel1.AutoScroll = true;
            this.flowLayoutPanel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.flowLayoutPanel1.Font = new System.Drawing.Font ( "Microsoft Sans Serif",
            8FSystem.Drawing.FontStyle.Italic,
            System.Drawing.GraphicsUnit.Point, ( ( byte ) ( 0 ) ) );
            this.flowLayoutPanel1.ForeColor = System.Drawing.Color.Blue;
            this.flowLayoutPanel1.Location = new System.Drawing.Point ( XY );
            this.flowLayoutPanel1.Name = "flowLayoutPanel1";
            this.flowLayoutPanel1.Size = new System.Drawing.Size ( WH );
            this.flowLayoutPanel1.TabIndex = 2;
        }
        /*============================================================*/
        void TextBox_1 ( int Xint Yint Wint H ) {
            //this.label1.AutoSize = true;
            textBox1.Font = new System.Drawing.Font ( "Microsoft Sans Serif",
            8FSystem.Drawing.FontStyle.Italic,
            System.Drawing.GraphicsUnit.Point, ( ( byte ) ( 0 ) ) );
            textBox1.ForeColor = System.Drawing.Color.Blue;
            textBox1.Location = new System.Drawing.Point ( XY );
            textBox1.Name = "textBox1";
            textBox1.Size = new System.Drawing.Size ( WH );
            textBox1.TabIndex = 3;
        }
        /*============================================================*/
        void Label_1 ( int Xint Yint Wint Hstring st ) {
            //this.label1.AutoSize = true;
            this.label1.Font = new System.Drawing.Font ( "Microsoft Sans Serif",
9.75FSystem.Drawing.FontStyle.Italic
System.Drawing.GraphicsUnit.Point, ( ( byte ) ( 0 ) ) );
            this.label1.ForeColor = System.Drawing.Color.Blue;
            this.label1.Location = new System.Drawing.Point ( XY );
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size ( WH );
            this.label1.TabIndex = 3;
            this.label1.Text += st;
        }
        /*============================================================*/
        public Form1 ( ) {
            InitializeComponent ( );
        }
        /*============================================================*/
        public void Button_1 ( int Xint Yint Wint Hstring st ) {
            button1.Location = new Point ( XY );
            this.button1.Size = new System.Drawing.Size ( WH );
            button1.Font = new Font ( "Times New Roman"10F,
             System.Drawing.FontStyle.ItalicSystem.Drawing.GraphicsUnit.Point0 );
            button1.BackColor = Color.Pink;
            button1.ForeColor = Color.FromArgb ( 000 );
            this.button1.Text = st;
        }
        /*============================================================*/

Nenhum comentário:

Postar um comentário