- [DEVEXPRESS] Chia sẻ code các tạo report in nhiều hóa đơn trên XtraReport C#
- [POWER AUTOMATE] Hướng dẫn gởi tin nhắn zalo từ file Excel - No code
- [C#] Chia sẻ code lock và unlock user trong domain Window
- [SOFTWARE] Giới thiệu bộ phần mềm tính Kết Cấu Thép HatteSale, Mộng Đơn, Dầm, Sàn, Móng Cọc, Vách, Xà Gồ, Tính Tải Trọng
- [DEVEXPRESS] Vẽ Biểu Đồ Stock Chứng Khoán - Công Cụ Thiết Yếu Cho Nhà Đầu Tư trên Winform
- [C#] Hướng dẫn bảo mật ứng dụng 2FA (Multi-factor Authentication) trên Winform
- [C#] Hướng dẫn convert HTML code sang PDF File trên NetCore 7 Winform
- [C#] Hướng dẫn viết ứng dụng chat với Gemini AI Google Winform
- Hướng dẫn khóa file bằng nhiều process id, không cho xóa tập tin
- Hướng dẫn cách tạo Product Id cho ứng dụng phần mềm XXXXX-XXXXX-XXXXX-XXXXX
- [SQLSERVER] Hướng dẫn tạo script sql từ ứng dụng Sqlserver management Studio
- [C#] Hướng dẫn sử dụng thư viện AutoITx lấy id và password Ultraviewer trên winform
- [VB.NET] Hướng dẫn lấy thông tin tài khoản đăng nhập windows và khởi động lại ứng dụng ở chế độ Administrator
- [C#] Sử dụng thư viện Polly gửi lại request api khi request bị lỗi hay rớt mạng
- [DEVEXPRESS] Chia sẻ source code tạo báo cáo report in tem nhãn label trên C# winform
- [DEVEXPRESS] Hướng dẫn vẽ biểu đồ Bar Chart trên Winform
- [C#] Tạo form đăng nhập và đăng ký với hiệu ứng Sliding Animation Effect
- [C#] Hướng dẫn tạo thanh toán đơn hàng qua mã vạch VietQR sử dụng API PayOS hoàn toàn miễn phí
- [C#] Hướng dẫn ghi log ra RichTextBox giống Console trên Winform sử dụng thư viện Serilog
- [C#] Hướng dẫn cách tạo mã QR Code trên file Excel
[C#] Hướng dẫn tạo hiệu ứng text Fake Typer Effect Winform
Xin chào các bạn, bài viết hôm nay mình sẽ tiếp tục hướng dẫn các bạn cách tạo hiệu ứng Auto Fake Typer Text Effect trong lập trình C# Winform.
Các bạn có thể sử dụng bài hướng dẫn này để làm cho form giới thiệu ứng dụng.
Hoặc dùng trong các form giống mấy form tạo key gen, hay tool auto...
Dưới đây là giao diện demo ứng dụng Auto Fake Typer Text Effect C# Winform:
Source code C# Text Effect:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace FakerType_TextEffect
{
public partial class Form1 : Form
{
private char[] _chars;
private int _index;
public Form1()
{
InitializeComponent();
_chars = richTextBox1.Text.ToCharArray();
}
private void richTextBox2_KeyPress(object sender, KeyPressEventArgs e)
{
if(_index< _chars.Length)
{
//richTextBox2.Text += _chars[_index];
richTextBox2.AppendText(_chars[_index] + "");
_index++;
}
e.Handled = true;
}
bool flag = false;
private void timer1_Tick(object sender, EventArgs e)
{
string a = "";
if (_index < _chars.Length)
{
if(_index > 0)
{
a = _chars[_index - 1].ToString();
}
if(a == "
")
{
flag = true;
}
else
{
flag = false;
}
//richTextBox2.Text += _chars[_index];
richTextBox2.AppendText(_chars[_index] + "");
_index++;
}
}
private void chk_auto_CheckedChanged(object sender, EventArgs e)
{
if (chk_auto.Checked)
{
richTextBox2.Clear();
richTextBox2.Focus();
timer1.Start();
_index = 0;
}
else
{
timer1.Stop();
}
}
private void richTextBox2_TextChanged(object sender, EventArgs e)
{
richTextBox2.SelectionStart = richTextBox2.Text.Length;
if (!richTextBox2.ReachedBottom() && flag)
{
richTextBox2.ScrollToCaret();
}
}
}
public static class RichTextBoxExtension
{
[DllImport("user32")]
private static extern int GetScrollInfo(IntPtr hwnd, int nBar,
ref SCROLLINFO scrollInfo);
public struct SCROLLINFO
{
public int cbSize;
public int fMask;
public int min;
public int max;
public int nPage;
public int nPos;
public int nTrackPos;
}
public static bool ReachedBottom(this RichTextBox rtb)
{
SCROLLINFO scrollInfo = new SCROLLINFO();
scrollInfo.cbSize = Marshal.SizeOf(scrollInfo);
//SIF_RANGE = 0x1, SIF_TRACKPOS = 0x10, SIF_PAGE= 0x2
scrollInfo.fMask = 0x10 | 0x1 | 0x2;
GetScrollInfo(rtb.Handle, 1, ref scrollInfo);//nBar = 1 -> VScrollbar
return scrollInfo.max == scrollInfo.nTrackPos + scrollInfo.nPage + 1;
}
}
}
Thanks for watching!