本文整理汇总了C#中Panel类的典型用法代码示例。如果您正苦于以下问题:C# Panel类的具体用法?C# Panel怎么用?C# Panel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Panel类属于命名空间,在下文中一共展示了Panel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TaskAutoScroll
public TaskAutoScroll(Manager manager)
: base(manager) {
Height = 360;
MinimumHeight = 99;
MinimumWidth = 78;
Text = "Auto Scrolling";
Center();
pnl1 = new Panel(manager);
pnl1.Init();
pnl1.Parent = this;
pnl1.Width = 400;
pnl1.Height = 180;
pnl1.Left = 20;
pnl1.Top = 20;
pnl1.BevelBorder = EBevelBorder.All;
pnl1.BevelStyle = EBevelStyle.Flat;
pnl1.BevelMargin = 1;
pnl1.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right;
pnl1.AutoScroll = true;
pnl2 = new Panel(manager);
pnl2.Init();
pnl2.Parent = this;
pnl2.Width = 400;
pnl2.Height = 320;
pnl2.Left = 40;
pnl2.Top = 80;
pnl2.BevelBorder = EBevelBorder.All;
pnl2.BevelStyle = EBevelStyle.Flat;
pnl2.BevelMargin = 1;
pnl2.Text = "2";
pnl2.Anchor = EAnchors.Left | EAnchors.Top;
pnl2.Color = Color.White;
}
示例2: displayInformationForUnit
private void displayInformationForUnit(IGameEntity entity) {
//Remove previous values
hideExtendedInformationPanel();
//Display window info
windowInfo.GetComponent<Image>().enabled = true;
currentPanel = Panel.UNIT;
currentObject = (MonoBehaviour)entity;
List<String> titles = new List<String>();
titles.Add("Attack rate");
titles.Add("Attack range");
titles.Add("Movement rate");
titles.Add("Resistance");
titles.Add("Sight range");
titles.Add("Strenght");
titles.Add("Weapon Ability");
List<String> values = new List<String>();
values.Add(entity.info.unitAttributes.attackRate.ToString());
values.Add(entity.info.unitAttributes.attackRange.ToString());
values.Add(entity.info.unitAttributes.movementRate.ToString());
values.Add(entity.info.unitAttributes.resistance.ToString());
values.Add(entity.info.unitAttributes.sightRange.ToString());
values.Add(entity.info.unitAttributes.strength.ToString());
values.Add(entity.info.unitAttributes.weaponAbility.ToString());
displayInformation(titles, values);
}
示例3: _panelControl
private void _panelControl(Panel pnl)
{
pnl_all.Visible = false;
pnl_delete.Visible = false;
pnl_update.Visible = false;
pnl.Visible = true;
}
示例4: Calculate31
public static void Calculate31 (List<Node> result, Beat beat, int distance_from_start, Panel a, Panel b, Panel c, Panel d) {
if (!Panel.IsBracketable(a.index, b.index, c.index)) { return; }
Iterate.Foot2((foot_a, foot_b) => {
Iterate.Part1(foot_b, (b_0) => {
{
Node state = new Node(beat.second, distance_from_start);
state.limbs[foot_a] = new Limb();
LimbHelper.Do3Bracket(state, foot_a, true, beat, a, b, c);
state.limbs[foot_b] = new Limb();
state.limbs[foot_b][b_0] = new Part(beat, d);
state.sanityCheck();
result.Add(state);
}
{
Node state = new Node(beat.second, distance_from_start);
state.limbs[foot_a] = new Limb();
LimbHelper.Do3Bracket(state, foot_a, false, beat, a, b, c);
state.limbs[foot_b] = new Limb();
state.limbs[foot_b][b_0] = new Part(beat, d);
state.sanityCheck();
result.Add(state);
}
});
});
}
示例5: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
PrintSettingBLL.Reload();
int campID = Request["CampaignID"].ToInt();
string rptType = Request["RptType"];
if (campID == 0
|| string.IsNullOrEmpty(rptType)) return;
ReportType type = (ReportType)rptType.ToInt();
List<Donation> pl = DonationBLL.Get(campID, type);
foreach (Donation item in pl)
{
Panel p = new Panel();
p.Style.Add("position", "relative");
p.Style.Add("page-break-after", "always");
p.Style.Apply(PrintSettingBLL.Envelope.PaperSize);
p.Style.Add("border", "1px solid white");
divCon.Controls.Add(p);
AddControl(item, p);
}
}
示例6: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
List<Event> events = Event.GetAllEvents();
foreach (Event selectedEvent in events)
{
Panel pnlEvent = new Panel();
pnlEvent.ID = selectedEvent.ID.ToString();
pnlEvent.Attributes.Add("class", "panel");
CheckBox chkbxEventName = new CheckBox();
chkbxEventName.ID = "chkbx" + selectedEvent.Name;
chkbxEventName.Text = selectedEvent.Name;
pnlEvent.Controls.Add(chkbxEventName);
for (int i = 0; i < selectedEvent.MaxTeamSize; i++)
{
TextBox txtbxTTID = new TextBox();
txtbxTTID.ID = "TTID" + (i + 1).ToString() + selectedEvent.ID;
txtbxTTID.Attributes.Add("placeholder", "TTID " + (i + 1).ToString());
txtbxTTID.Attributes.Add("style", "display:none;");
pnlEvent.Controls.Add(txtbxTTID);
RegularExpressionValidator rev = new RegularExpressionValidator();
rev.ControlToValidate = txtbxTTID.ClientID;
rev.Attributes.Add("style", "display:none;");
rev.ValidationExpression = "\\d{4}";
rev.ErrorMessage = "*";
pnlEvent.Controls.Add(rev);
}
pnlEvents.Controls.Add(pnlEvent);
}
}
示例7: AddDisplay
public override void AddDisplay(Panel panel, int contentId, int inputDataId)
{
var p = new Dictionary<string, object> {{"@InputDataId", inputDataId}};
string CSSclassName = ManageDB.GetFirstValueFromQuery<string>(@"
SELECT eic.CSSclass
FROM ElementInContent AS eic INNER JOIN
InputDataSimpleText AS idt ON eic.Id = idt.ElementInContentId
WHERE (idt.id = @InputDataId)
", p);
Label lblLabel = new Label();
lblLabel.CssClass = CSSclassName + "_label";
lblLabel.Text = GetLabelValue(inputDataId);
Label lblValue = new Label();
lblValue.CssClass = CSSclassName + "_value";
lblValue.Text = GetLabelValue(inputDataId);
GenericContent.AddHtmlToPanel("<div id=\"inputElementData_" + inputDataId + "\">", panel);
panel.Controls.Add(lblLabel);
GenericContent.AddHtmlToPanel("<br />", panel);
panel.Controls.Add(lblValue);
GenericContent.AddHtmlToPanel("</div>", panel);
}
示例8: SendHTMLMail
public static void SendHTMLMail(string mailfrom, string mailto, string mailSubject, Panel panel)
{
try
{
//mailto = "[email protected]";
MailMessage mail = new MailMessage(mailfrom, mailto);
mail.IsBodyHtml = true;
mail.Subject = mailSubject;
mail.BodyEncoding = Encoding.UTF8;
//for test
//String mailcc = "[email protected]";
//mail.CC.Add(mailcc);
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
panel.RenderControl(hw);
mail.Body = sw.ToString();
//SmtpClient smtpClient = new SmtpClient("127.0.0.1",25);//設定E-mail Server和port
//SmtpClient smtpClient = new SmtpClient("localhost", 25);//設定E-mail Server和port
//SmtpClient smtpClient = new SmtpClient("192.168.1.20", 25);//設定E-mail Server和port
SmtpClient smtpClient = new SmtpClient(); //從WEB.CONFIG讀SMTP CONFIG
smtpClient.Send(mail);
}
catch (Exception ex)
{
throw ex;
}
}
示例9: GetCameraID
private async Task<DeviceInformation> GetCameraID(Panel desiredCamera)
{
DeviceInformation deviceID = (await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture))
.FirstOrDefault(x => x.EnclosureLocation != null && x.EnclosureLocation.Panel == desiredCamera);
if (deviceID != null) return deviceID;
else throw new Exception(string.Format("Camera of type {0} doesn't exist.", desiredCamera));
}
示例10: LoginOK_Click
private void LoginOK_Click(object sender, EventArgs e)
{
Panel Panel = new Panel();
Panel.Show();
Program.Start1.Hide();
this.Close();
}
示例11: PendingTransactionGridView_RowDataBound
protected void PendingTransactionGridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.DataItem != null)
{
var mainPanel = new Panel { CssClass= "btn-group" };
var approveButton = new Button
{
CssClass = "btn btn-default",
CommandArgument = e.Row.Cells[0].Text,
CommandName = "Approve",
Text = "Approve"
};
var rejectButton = new Button
{
CssClass = "btn btn-default",
CommandArgument = e.Row.Cells[0].Text,
CommandName = "Reject",
Text = "Reject",
};
var lastIndex = e.Row.Cells.Count == 0 ? 0 : e.Row.Cells.Count - 1;
mainPanel.Controls.Add(approveButton);
mainPanel.Controls.Add(rejectButton);
e.Row.Cells[lastIndex].Controls.Add(mainPanel);
e.Row.Cells[lastIndex].HorizontalAlign = HorizontalAlign.Right;
}
}
示例12: GameField
private readonly int[,] myMatrix; // The matrix to show info to the user
#endregion Fields
#region Constructors
public GameField(int iRow, int iCol, int bomb_no, Panel panel)
{
Panel = panel;
mTimer = new Stopwatch();
RowSize = iRow; // rowSize is the size of the row which is bigger than size of the row of the field
ColSize = iCol; // same for the column
BombNum = bomb_no;
Field = new int[RowSize + 2, ColSize + 2];
myMatrix = new int[iRow, iCol];
for (int i = 0; i < RowSize + 2; i++)
{
for (int j = 0; j < ColSize + 2; j++)
{
Field[i, j] = (int) GameEnum.userUnchecked; //default value for the field!
}
}
for (int i = 0; i < iRow; i++)
{
for (int j = 0; j < iCol; j++)
{
myMatrix[i, j] = (int) GameEnum.userUnchecked;
}
}
}
示例13: Label
public Label(Panel parent, string text, SpriteFont font)
: base(parent)
{
Text = text;
Font = font ?? FontDefault;
Colour = Color.White;
}
示例14: AddSiteCellInnerHTML
private HtmlTableCell AddSiteCellInnerHTML(string name, string banner, string url)
{
HtmlTableCell cell = new HtmlTableCell();
Panel pnl = new Panel();
pnl.CssClass = "sitesbanerhome";
if(IsSitePage)
{
pnl.CssClass = "sitespagebaner";
}
HyperLink hl = new HyperLink();
hl.NavigateUrl = url;
hl.Attributes["rel"] = "nofollow";
hl.Target = "_blank";
if (banner != "")
{
Image i = new Image();
i.ImageUrl = Path.Combine(Utils.GaleryImagePath, banner);
hl.Controls.Add(i);
}
else
{
hl.Text = name;
}
pnl.Controls.Add(hl);
cell.Controls.Add(pnl);
return cell;
}
示例15: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
List<Event> events = Event.GetAllEvents();
foreach (Event ev in events)
{
Panel pnlEvent = new Panel();
pnlEvent.ID = ev.ID.ToString();
Label lblEventName = new Label();
lblEventName.Text = ev.Name;
Label lblNumberOfParticipants = new Label();
pnlEvent.Controls.Add(lblEventName);
pnlEvent.Controls.Add(lblNumberOfParticipants);
GridView grdvwParticipation = new GridView();
grdvwParticipation.DataSource = Event.GetRegisteredParticipants(ev, 0);
grdvwParticipation.DataBind();
pnlEvent.Controls.Add(grdvwParticipation);
pnlDetails.Controls.Add(pnlEvent);
if (ev.IsSinglePlayer)
{
foreach (GridViewRow row in grdvwParticipation.Rows)
{
row.Cells[0].Text = "TT" + row.Cells[0].Text;
}
lblNumberOfParticipants.Text = "Total Participants: " + grdvwParticipation.Rows.Count.ToString();
}
else
{
var numberOfTeams = (from i in grdvwParticipation.Rows.Cast<GridViewRow>() select new { Teamid = i.Cells[0].Text }).Distinct().Count();
lblNumberOfParticipants.Text = "Total Teams: " + numberOfTeams.ToString();
}
}
}