我的window.cs [design]看起来不错,而且我希望它看起来如何,但是一旦运行程序,它就会变得透明,模糊,模糊,简直太糟糕了!我所有其他窗口看起来都很棒,看起来像应该看起来的样子。我正在Windows 10上运行。我不知道这是计算机问题还是Visual Studio问题。我也在使用Visual Studio 2012
这是我的设计窗口的外观
这是我执行程序后的样子
请注意,我的文本框变为透明,文本变为模糊/模糊。这是我使用的背景图片吗?是我的设定吗?
我没有发布任何代码,因为这只是一个设计问题。
这是我的窗口代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace LOGINPAGE
{
public partial class Room : Form
{
public Room()
{
InitializeComponent();
PassText.PasswordChar = '*';
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
this.Hide();
FloorSelection ss = new FloorSelection();
ss.Show();
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
}
private void EXIT_Click(object sender, EventArgs e)
{
this.Close();
Application.Exit();
}
private void xButton1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Mohamed\Documents\UserData.mdf;Integrated Security=True;Connect Timeout=30");
SqlDataAdapter sda = new SqlDataAdapter("Select Count (*) From dbo.[LOGIN] where username='" + UserText.Text + "' and Password ='" + PassText.Text + "'", con);
FloorSelection ss = new FloorSelection();
DataTable dt = new DataTable();
sda.Fill(dt);
if (dt.Rows[0][0].ToString() == "1")
{
SqlDataAdapter sda1 = new SqlDataAdapter("Select TYPE From dbo.[LOGIN] where username='" + UserText.Text + "' and Password ='" + PassText.Text + "'", con);
FloorSelection ss1 = new FloorSelection();
DataTable dt1 = new DataTable();
sda1.Fill(dt1);
if (dt1.Rows[0][0].ToString() == "FACULTY")
{
this.Hide();
FACULTY ff = new FACULTY();
ff.Show();
}
if (dt1.Rows[0][0].ToString() == "JANITOR")
{
this.Hide();
JANITOR jt = new JANITOR();
jt.Show();
if (dt1.Rows[0][0].ToString() == "ADMINISTRATOR")
{
this.Hide();
ADMINISTRATOR Admin = new ADMINISTRATOR();
Admin.Show();
}
else
{
MessageBox.Show("PLEASE CHECK YOUR USERNAME AND PASSWORD");
}
}
}
}
private void label3_Click(object sender, EventArgs e)
{
label3.BackColor = Color.Empty;
}
private void UserText_TextChanged(object sender, EventArgs e)
{
}
private void PassText_TextChanged(object sender, EventArgs e)
{
}
}
}
看起来您的窗体的TransparencyKey
属性设置为白色。这意味着表单中的每个白色像素都将变为透明。这似乎与您所看到的视觉效果相符。
要关闭透明度,请在Visual Studio属性窗口中将设置TransparencyKey
为Color.Empty
或选择该属性,然后按Delete键。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句