本文整理汇总了C#中Panel类的典型用法代码示例。如果您正苦于以下问题:C# Panel类的具体用法?C# Panel怎么用?C# Panel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Panel类属于命名空间,在下文中一共展示了Panel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:35,代码来源:TaskAutoScroll.cs
示例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);
}
开发者ID:srferran,项目名称:ES2015A,代码行数:29,代码来源:InformationController.Extended.cs
示例3: _panelControl
private void _panelControl(Panel pnl)
{
pnl_all.Visible = false;
pnl_delete.Visible = false;
pnl_update.Visible = false;
pnl.Visible = true;
}
开发者ID:jacqueline27hh,项目名称:Dryden,代码行数:7,代码来源:career.aspx.cs
示例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);
}
});
});
}
开发者ID:baguio,项目名称:SSC-AI,代码行数:26,代码来源:Node4Calculator.cs
示例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);
}
}
开发者ID:ghostnguyen,项目名称:redblood,代码行数:29,代码来源:EnvelopePrint.aspx.cs
示例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);
}
}
开发者ID:priyanshu92,项目名称:EventManagementSystem,代码行数:30,代码来源:EventRegister.aspx.cs
示例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);
}
开发者ID:queer1,项目名称:Gaymer2.0,代码行数:25,代码来源:SimpleText.cs
示例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;
}
}
开发者ID:AdamsChao,项目名称:netdb-localdev-proj,代码行数:32,代码来源:MailUtil.cs
示例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));
}
开发者ID:StarGate01,项目名称:LockEx,代码行数:7,代码来源:Flashlight.cs
示例10: LoginOK_Click
private void LoginOK_Click(object sender, EventArgs e)
{
Panel Panel = new Panel();
Panel.Show();
Program.Start1.Hide();
this.Close();
}
开发者ID:alucha,项目名称:ProjektGrupowy,代码行数:7,代码来源:Logowanie.cs
示例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;
}
}
开发者ID:AakanxuShah,项目名称:SecureBankSystem,代码行数:26,代码来源:EmployeeHome.aspx.cs
示例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;
}
}
}
开发者ID:JLignell,项目名称:Minesweeper,代码行数:33,代码来源:GameField.cs
示例13: Label
public Label(Panel parent, string text, SpriteFont font)
: base(parent)
{
Text = text;
Font = font ?? FontDefault;
Colour = Color.White;
}
开发者ID:zdawson,项目名称:Marooned,代码行数:7,代码来源:Label.cs
示例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;
}
开发者ID:ivladyka,项目名称:OurTravels,代码行数:27,代码来源:SiteTableView.ascx.cs
示例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();
}
}
}
开发者ID:priyanshu92,项目名称:EventManagementSystem,代码行数:32,代码来源:EventWiseParticipation.aspx.cs
示例16: InitializeWidget
private void InitializeWidget(LayoutOrientation orientation)
{
sceneBackgroundPanel = new Panel();
sceneBackgroundPanel.Name = "sceneBackgroundPanel";
PagePanel_1 = new PagePanel();
PagePanel_1.Name = "PagePanel_1";
// sceneBackgroundPanel
sceneBackgroundPanel.BackgroundColor = new UIColor(0f / 255f, 0f / 255f, 0f / 255f, 255f / 255f);
// PagePanel_1
PagePanel_1.AddPage(new InstructionsPanel());
PagePanel_1.AddPage(new Instructions2());
PagePanel_1.AddPage(new Insructions3());
PagePanel_1.AddPage(new Instructions4());
PagePanel_1.AddPage(new instruction5Panel());
PagePanel_1.AddPage(new Instructions6Panel());
PagePanel_1.AddPage(new Instructions8Panel());
PagePanel_1.AddPage(new Instructions7Panel());
// InstructionsScene
this.RootWidget.AddChildLast(sceneBackgroundPanel);
this.RootWidget.AddChildLast(PagePanel_1);
SetWidgetLayout(orientation);
UpdateLanguage();
}
开发者ID:phoenixperry,项目名称:crystallography,代码行数:28,代码来源:InstructionsScene.composer.cs
示例17: BorderlessWindow
public BorderlessWindow()
{
this.SuspendLayout();
this.AutoScaleDimensions = new SizeF(6F, 13F);
this.AutoScaleMode = AutoScaleMode.Font;
this.FormBorderStyle = FormBorderStyle.None;
this.Size = new Size(800, 600);
this.MinimumSize = new Size(144, 36); // 4:1 size ratio
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "BorderlessWindow";
this.Text = "";
CreateSystemButtonImages(this.BackColor);
SystemButtonClose = CreateSystemButton(SystemButtonCloseKey, GetSystemButtonsLocation());
SystemButtonMaximize = CreateSystemButton(SystemButtonMaximizeKey, SystemButtonClose.Left - 36);
SystemButtonMinimize = CreateSystemButton(SystemButtonMinimizeKey, SystemButtonMaximize.Left - 36);
PanelClientArea = CreateClientAreaPanel();
SystemButtonMinimize.Click += new System.EventHandler(this.OnSystemButtonMinimizeClick);
SystemButtonMaximize.Click += new System.EventHandler(this.OnSystemButtonMaximizeClick);
SystemButtonClose.Click += new System.EventHandler(this.OnSystemButtonCloseClick);
this.Controls.Add(SystemButtonMinimize);
this.Controls.Add(SystemButtonMaximize);
this.Controls.Add(SystemButtonClose);
this.Controls.Add(PanelClientArea);
this.ResumeLayout(false);
}
开发者ID:ArchangelNexus,项目名称:Abstract-Design-Utility,代码行数:30,代码来源:BorderlessWindow.cs
示例18: MainForm
public MainForm ()
{
//
// _splitter
//
_splitter = new Splitter ();
_splitter.BorderStyle = BorderStyle.FixedSingle;
_splitter.Dock = DockStyle.Bottom;
Controls.Add (_splitter);
//
// _panel
//
_panel = new Panel ();
_panel.Dock = DockStyle.Bottom;
_panel.Height = 75;
_panel.BackColor = SystemColors.Control;
Controls.Add (_panel);
//
// _label
//
_label = new Label ();
_label.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom;
_label.Height = 75;
_label.Width = _panel.Width - 4;
_panel.Controls.Add (_label);
//
// MainForm
//
BackColor = Color.White;
ClientSize = new Size (300, 150);
Location = new Point (250, 100);
StartPosition = FormStartPosition.Manual;
Text = "bug #338966";
Load += new EventHandler (MainForm_Load);
}
开发者ID:mono,项目名称:gert,代码行数:35,代码来源:MainForm.cs
示例19: DemoScreen
public DemoScreen()
{
this.mainMenuPanel = new Panel { Size = new Size(30, 30), RelativeLocation = new Coordinate(2, 1) };
this.Controls.Add(this.mainMenuPanel);
this.mainMenuTextLabel =
new Label
{
Size = new Size(30, 7),
Text = "This is the main menu. You can select items with the UP and DOWN arrows or the W and S keys (this can be customized). Press enter if you want to see the presentation."
};
this.mainMenuPanel.Controls.Add(mainMenuTextLabel);
this.mainMenu = new Menu<Action> { RelativeLocation = new Coordinate(0, 7), Size = new Size(15, 10) };
this.mainMenu.Items.Add(new MenuItem<Action>("Label", this.ShowLabelDemo));
this.mainMenu.Items.Add(new MenuItem<Action>("ListView", this.ShowListViewDemo));
this.mainMenu.Items.Add(new MenuItem<Action>("TextBox", this.ShowTextBoxDemo));
this.mainMenu.Items.Add(new MenuItem<Action>("Rectangle", this.ShowRectangleDemo));
this.mainMenu.Items.Add(new MenuItem<Action>("Line", this.ShowLineDemo));
this.mainMenu.Items.Add(new MenuItem<Action>("Ellipse", this.ShowEllipseDemo));
this.mainMenu.Items.Add(new MenuItem<Action>("Exit", this.Exit));
this.mainMenu.UpKeys.Add(ConsoleKey.W);
this.mainMenu.DownKeys.Add(ConsoleKey.S);
this.mainMenu.ItemChosen += mainMenu_ItemChosen;
this.mainMenuPanel.Controls.Add(this.mainMenu);
}
开发者ID:dineshkummarc,项目名称:FlagConsole,代码行数:29,代码来源:DemoScreen.cs
示例20: _panelControl
private void _panelControl(Panel pnl)
{
pnl_add.Visible = false;
pnl_viewAll.Visible = false;
pnlUpdate.Visible = false;
pnl.Visible = true;
}
开发者ID:resh2302,项目名称:BRDHC-BkUp,代码行数:7,代码来源:eventAdmin.aspx.cs
注:本文中的Panel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论