可弹出的窗口中标题文字还是没有居中对齐。哪位知道下面这句有什么问题吗?
_name.TextAlign = ContentAlignment.MiddleCenter;
public void ShowForm()
{
switch (this.InfoState)
{
case InformStyle.Vanish://窗体隐藏
this.InfoState = InformStyle.Displaying;//设置窗体的操作状态为显示中
this.SetBounds(Rect.X, Rect.Y + Rect.Height, Rect.Width, 0);//显示Popup窗体,并放置到屏幕的底部
ShowWindow(this.Handle, 4);//显示窗体
this.timer1.Interval = 100;//设置时间间隔为100
this.timer1.Start();//启动计时器
_name.Text = cls_popup._name;
_content.Text = cls_popup._content;
_name.TextAlign = ContentAlignment.MiddleCenter;
break;
case InformStyle.Display://窗体显示
//this.timer1.Stop();//停止计时器
//this.timer1.Interval = 5000;//设置时间间隔为5000
//this.timer1.Start();//启动记时器
//break;
this.InfoState = InformStyle.Displaying;//设置窗体的操作状态为显示中
this.SetBounds(Rect.X, Rect.Y + Rect.Height, Rect.Width, 0);//显示Popup窗体,并放置到屏幕的底部
ShowWindow(this.Handle, 4);//显示窗体
this.timer1.Interval = 100;//设置时间间隔为100
this.timer1.Start();//启动计时器
_name.Text = cls_popup._name;
_content.Text = cls_popup._content;
_name.TextAlign = ContentAlignment.MiddleCenter;
break;
}
}
_name.TextAlign = ContentAlignment.MiddleCenter;
public void ShowForm()
{
switch (this.InfoState)
{
case InformStyle.Vanish://窗体隐藏
this.InfoState = InformStyle.Displaying;//设置窗体的操作状态为显示中
this.SetBounds(Rect.X, Rect.Y + Rect.Height, Rect.Width, 0);//显示Popup窗体,并放置到屏幕的底部
ShowWindow(this.Handle, 4);//显示窗体
this.timer1.Interval = 100;//设置时间间隔为100
this.timer1.Start();//启动计时器
_name.Text = cls_popup._name;
_content.Text = cls_popup._content;
_name.TextAlign = ContentAlignment.MiddleCenter;
break;
case InformStyle.Display://窗体显示
//this.timer1.Stop();//停止计时器
//this.timer1.Interval = 5000;//设置时间间隔为5000
//this.timer1.Start();//启动记时器
//break;
this.InfoState = InformStyle.Displaying;//设置窗体的操作状态为显示中
this.SetBounds(Rect.X, Rect.Y + Rect.Height, Rect.Width, 0);//显示Popup窗体,并放置到屏幕的底部
ShowWindow(this.Handle, 4);//显示窗体
this.timer1.Interval = 100;//设置时间间隔为100
this.timer1.Start();//启动计时器
_name.Text = cls_popup._name;
_content.Text = cls_popup._content;
_name.TextAlign = ContentAlignment.MiddleCenter;
break;
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货