NEWS

[DEVEXPRESS] Auto Demo Trainning ứng dụng Sử dụng thư viện Tutorials

[DEVEXPRESS] Auto Demo Trainning ứng dụng  Sử dụng thư viện Tutorials
Đăng bởi: Thảo Meo - Lượt xem: 3950 10:59:24, 14/04/2020C#   In bài viết

Xin chào các bạn, bài viết hôm nay mình sẽ hướng dẫn các bạn viết một ứng dụng tự động trainning phần mềm sử dụng thư viện Tutorials của Devexpress C#.

[DEVEXPRESS] Auto Demo Tranning Application

Trong lập trình ứng dụng, khi các bạn bàn giao phần mềm, thì thường có phần hướng dẫn sử dụng và cách thao tác phần mềm.

Bài viết này, mình viết đơn giản khi click vào button Action Demo, thì phần mềm sẽ tự động và hướng dẫn sử dụng phần mềm.

Dưới đây, là phần mềm demo Auto Demo Trainning C#

Những bước thực hiện dưới hình này này là tự động.

auto_action_app

Để sử dụng được các bạn cần import thư viện: Devexpress.Tutorials.dll vào nhé.

Trong thư viện này có một class ActiveDemo, cung cấp cho chúng ta các action: MouseMoveToPoint, MouseClick, MouseDoubleClick, MouseUp, MouseDown, SendString, SendKey...

auto_demo_csharp

với những hành động này, ta có thể sử dụng để cho phần mềm tự động chạy.

Và có sử dụng thuộc tính ActiveActions.Delay(1000);  để chờ thời gian thực hiện giữa các bước.

Code Auto Demo Tranning Application C#:

using DevExpress.ActiveDemos;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;

using System.Windows.Forms;

namespace ActiveDemoApp
{
    public partial class Form1 : DevExpress.XtraEditors.XtraForm
    {
        public Form1()
        {
            InitializeComponent();
        }
        ActiveDemo activedemo;
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            ClearTextBox();
            activedemo = new ActiveDemo();
            var point = new Point(10, txt_name.Height / 2);
            activedemo.ShowMessage("Bắt đầu thêm thông tin.");
            activedemo.Actions.MoveMousePointTo(txt_name, point);
            activedemo.Actions.MouseClick(txt_name, point);
            activedemo.ShowMessage("Nhập họ và tên.");
            activedemo.Actions.Dispose();
            SendKeys.SendWait("Nguyễn Thảo");

            point = new Point(10, txt_job.Height / 2);
            activedemo.Actions.MoveMousePointTo(txt_job, point);
            activedemo.Actions.MouseClick(txt_job, point);
            activedemo.ShowMessage("Nhập ngành nghề.");
            ActiveActions.Delay(1000);
            SendKeys.SendWait("Cài Win dạo, code dạo...");
            ActiveActions.Delay(1000);

            point = new Point(10, txt_address.Height / 2);
            activedemo.Actions.MoveMousePointTo(txt_address, point);
            activedemo.Actions.MouseClick(txt_address, point);
            activedemo.ShowMessage("Nhập địa chỉ vào đây.");
            ActiveActions.Delay(1000);           
            SendKeys.SendWait("Trung Thành, Quảng Thành, Châu Đức, Bà Rịa Vũng Tàu");
            ActiveActions.Delay(1000);   
           
            point = new Point(10, txt_email.Height / 2);
            activedemo.Actions.MoveMousePointTo(txt_email, point);
            activedemo.Actions.MouseClick(txt_email, point);
            activedemo.ShowMessage("Nhập địa chỉ email");         
            ActiveActions.Delay(1000);
            SendKeys.SendWait("nguyenthao_it@hotmail.com.vn");
            ActiveActions.Delay(1000);          
        
            point = new Point(10, txt_phone.Height / 2);
            activedemo.Actions.MoveMousePointTo(txt_phone, point);
            activedemo.Actions.MouseClick(txt_phone, point);
            activedemo.ShowMessage("Nhập số điện thoại");           
            ActiveActions.Delay(1000);
            SendKeys.SendWait("0933913122");
        }

        private void ClearTextBox()
        {
            txt_name.Text = "";
            txt_job.Text = "";
            txt_email.Text = "";
            txt_address.Text = "";
            txt_phone.Text = "";
        }

    }
}

Thanks for watching!

DOWNLOAD SOURCE

 

THÔNG TIN TÁC GIẢ

BÀI VIẾT LIÊN QUAN

[DEVEXPRESS] Auto Demo Trainning ứng dụng  Sử dụng thư viện Tutorials
Đăng bởi: Thảo Meo - Lượt xem: 3950 10:59:24, 14/04/2020C#   In bài viết

CÁC BÀI CÙNG CHỦ ĐỀ

Đọc tiếp
.