C# - 当用户滚动到富文本框的底部时,如何显示复选框

时间:2018-06-13 13:29:15

标签: c# winforms

所以,我试图让用户滚动到我的富文本框的底部,一旦它们到达底部,我希望复选框变得可见。我在网上搜索并尝试了一些解决方案但它们还没有工作。任何帮助都会有所帮助。谢谢

using System;
using System.Windows.Forms;
using System.IO;
using System.Text;
using System.Runtime.InteropServices;
using System.Drawing;
using Microsoft.Office.Core;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using EUSAA;
using System.Threading.Tasks;

namespace EUSAA
{
    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();

            txtDateTime.Text = DateTime.Now.ToString();
            txtUsername.Text = 
System.Security.Principal.WindowsIdentity.GetCurrent().Name;
            btnClose.Visible = false;
            chkAgree.Visible = false;
            rtbSecurityAwareness.LoadFile("Security Awareness.rtf");
        }

        private void chkAgree_CheckedChanged(object sender, EventArgs e)
        {
            if (chkAgree.Checked)
            {
                btnClose.Visible = true;
            }
            else btnClose.Visible = false;
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            using (StreamWriter sw = File.AppendText(@"I:\Security Awareness 
Signed Users\Signed Users.txt"))
            {

sw.WriteLine(System.Security.Principal.WindowsIdentity.GetCurrent().Name + 
"\t" + DateTime.Now.ToString());
            }
            Environment.Exit(0);
        }

    }
}

0 个答案:

没有答案