用C#完成类似于OFFICE中查找/替换中的高级选项效果
发布日期:2021-05-07 10:36:21 浏览次数:19 分类:原创文章

本文共 466 字,大约阅读时间需要 1 分钟。

 

 

        private void btnAdvance_Click(object sender, EventArgs e)

        {

            if (!gbAdvance.Visible)

            {

                gbAdvance.Visible = true;

                this.Height = ht + gbAdvance.Height;

                btnAdvance.Text = "隐藏高级选项(&H)";

            }

            else

            {

                gbAdvance.Visible = false;

                this.Height = ht;

                btnAdvance.Text = "显示高级选项(&S)";

            }

        }

 

        private void 窗体名称_Load(object sender, EventArgs e)

        {

            ht=gbContents.Height + panControls.Height+SystemInformation.CaptionHeight+SystemInformation.BorderSize.Height*2;

            this.Height = ht;

        }

完成效果如图所示:

上一篇:C#实现窗口在右下角不越界
下一篇:用正则表达式过滤多余空格

发表评论

最新留言

第一次来,支持一个
[***.219.124.196]2025年04月13日 13时13分58秒