本文整理汇总了C#中System.Windows.Forms.Panel.Hide方法的典型用法代码示例。如果您正苦于以下问题:C# Panel.Hide方法的具体用法?C# Panel.Hide怎么用?C# Panel.Hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Panel
的用法示例。
在下文中一共展示了Panel.Hide方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: expandPanel
private void expandPanel(Panel panelName, Label l, PictureBox pb)
{
if (panelName.Visible == true)
{
panelName.Hide();
l.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(207)))), ((int)(((byte)(207)))), ((int)(((byte)(207)))));
rotateImage(pb, RotateFlipType.Rotate90FlipX);
}
else
{
panelName.Show();
l.ForeColor = System.Drawing.Color.Coral;
rotateImage(pb, RotateFlipType.Rotate90FlipX);
}
}
示例2: housekeeping
//---------------------------------------BEGIN HOUSEKEEPING----------------------------------------
public void housekeeping()
{
if (GV.debug == false)
{
this.Controls["savePackPanel"].Controls["testButton"].Hide();
}
if (GV.debug == true)
{
AllocConsole();
}
//this segment gets the location of where the text file will be saved
textFilePath = System.Reflection.Assembly.GetEntryAssembly().Location;
string temp = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
textFilePath = textFilePath.Remove(textFilePath.Length - temp.Length - 4);
missionPackage.MF = this;
//-------------------------------------Begin top panel creation----------------------------
GoalCreatorPanel goalCreatorPanel = new GoalCreatorPanel();
goalCreatorPanel.Name = GV.goalCreatorPanelName;
this.Controls.Add(goalCreatorPanel);
GoalDetailPanel goalDetailPanel = new GoalDetailPanel();
goalDetailPanel.Name = GV.goalDetailPanelName;
this.Controls.Add(goalDetailPanel);
MissionInfoPanel missionInfoPanel = new MissionInfoPanel();
missionInfoPanel.Name = GV.missionInfoPanelName;
this.Controls.Add(missionInfoPanel);
MissionPackagePanel missionPackagePanel = new MissionPackagePanel();
missionPackagePanel.Name = GV.missionPackagePanelName;
this.Controls.Add(missionPackagePanel);
AllMissionInfoPanel allMissionInfoPanel = new AllMissionInfoPanel();
allMissionInfoPanel.Name = GV.allMissionInfoPanelName;
this.Controls.Add(allMissionInfoPanel);
//-------------------------------------End top panel creation----------------------------
//-------------------------------------Begin bottom panel creation----------------------------
int numberGoalTypes = GV.goalTypeList[0].GetLength(1); //returns number of types of goals
for (int i = 0; i < numberGoalTypes; i++)
{
Panel panel = new Panel();
panel.Name = GV.goalTypeList[0][0, i];
createPanel(panel, GV.goalTypeList[i + 1]);
panel.Location = new Point(5, GV.detailPanelInitialY);
this.Controls[GV.goalDetailPanelName].Controls.Add(panel);
panel.Hide();
panel.BackgroundImage = GV.goaLPanelImage;
panel.BackgroundImageLayout = ImageLayout.Stretch;
//panel.BackColor = GV.goalPanelColor;
panel.BackColor = Color.Transparent;
panel.SizeChanged += new EventHandler(panel_SizeChanged);
//panel.VisibleChanged +=new EventHandler(panel_VisibleChanged);
Label titleLabel = new Label();
titleLabel.Text = GV.goalTypeList[0][0, i] + " Parameters";
titleLabel.AutoSize = true;
titleLabel.BackColor = Color.Transparent;
titleLabel.Font = GV.titleFont;
int titleLocationX = (GV.goalPanelHeight - TextRenderer.MeasureText(titleLabel.Text, titleLabel.Font).Width) / 2;
titleLabel.Location = new Point(titleLocationX, 6);
panel.Controls.Add(titleLabel);
}
//string[] t = GV.goalTypeList[0];
//This code automatically turns the orbit radioButton on
RadioButton rb = (RadioButton)goalCreatorPanel.Controls["orbitGoalRadioButton"];
rb.Checked = true;
rb.ForeColor = Color.Lime;
for (int i = missionPackage.missionList.Count - 1; i >= 0; i--)
{
missionPackage.missionList.RemoveAt(i);
}
missionPackage.addMission();
//This segment does final preparations for stuff
exceptionObjectHandling();
missionPackage.changeActiveMission(0);
missionPackage.clearAllFields();
missionPackage.populateGoalPanels();
}
示例3: PanelDisplay
/*************************************************makes the panels appear/disappear***************************************************************/
private void PanelDisplay(Panel panel, ToolStripMenuItem toolStripMenuItem)
{
/*make the corresponding panel appear/disappear*/
if (panel.Visible == false)
{
toolStripMenuItem.Checked = true;
panel.Show();
}
else
{
panel.Hide();
toolStripMenuItem.Checked = false;
}
}
示例4: SetupButton
private void SetupButton(VirtualController.Button button, Panel panel)
{
string name = button.ToString();
SlotShape shape = SlotShape.Rounded;
if (panel.Tag is string) try {
shape = (SlotShape)Enum.Parse(typeof(SlotShape), panel.Tag as string);
} catch (FormatException) { }
RegisterOverlay(button, panel.Bounds, panel.BackColor, shape);
panel.Tag = button;
panel.Hide();
}
示例5: SetupAxisGesture
private void SetupAxisGesture(AxisGesture ag, Panel panel)
{
VirtualController.Axis
stick = Util.StickFromGesture(ag),
axis = Util.AxisFromGesture(ag);
bool pos = Util.PoleFromGesture(ag);
SlotShape shape = SlotShape.Rounded;
if (panel.Tag is string) try {
shape = (SlotShape)Enum.Parse(typeof(SlotShape), panel.Tag as string);
} catch (FormatException) { }
AxisActions.Gestures axisGesture = pos ? AxisActions.Gestures.Positive : AxisActions.Gestures.Negative;
RegisterOverlay(axis, pos, panel.Bounds, panel.BackColor, shape);
panel.Hide();
panel.Tag = ag;
}
示例6: frmQuestions_Load
private void frmQuestions_Load(object sender, EventArgs e)
{
//Fonts used to display the question and the answer are set up here to make
//it easier to change the application style
Font questionFont = new Font("Tahoma", 10F);
Font answerFont = new Font("Tahoma", 10F);
//Parse the raw questions and render them to the panels
foreach (QuizQuestionRaw question in quizParameters.questions)
{
//Parse the question
try
{
IQuizQuestion parsedQuestion = RegexQuestions.CreateQuestion(question);
//Create a panel for it
Panel thisQuestionPanel = new Panel();
thisQuestionPanel.Parent = this;
thisQuestionPanel.Left = 0;
thisQuestionPanel.Width = this.ClientRectangle.Width;
thisQuestionPanel.Top = 0;
thisQuestionPanel.Height = this.Height - 20;
this.Controls.Add(thisQuestionPanel);
//Each question's panel is hidden in the beginning
thisQuestionPanel.Hide();
//Render the question to this panel and store it in the memory
parsedQuestion.Render(thisQuestionPanel, questionFont, answerFont);
quizQuestions.Add(parsedQuestion);
renderedQuestions.Add(thisQuestionPanel);
}
catch (UnknownQuestionTypeException)
{
MessageBox.Show("Unsupported question detected among questions fetched from the server.",
"ReQuiz Client", MessageBoxButtons.OK, MessageBoxIcon.Error);
Close();
return;
}
}
//Show the information about the quiz
MessageBox.Show("This test has " + quizParameters.questions.Count + " questions." + Environment.NewLine +
"You are allowed " + quizParameters.hintsAllowed + " hints." + Environment.NewLine +
"Each question is worth 2 marks." + Environment.NewLine +
"Each hint deducts 1 mark from your total score.");
//Show the form, the first question and the needed buttons
this.Show();
renderedQuestions[shuffledIDs[0]].Show();
UpdateStatusBar();
//Focus on the first question's answer field
quizQuestions[shuffledIDs[0]].FocusOnAnswerField();
//All the startup procedures were successful, set the flag
startupSuccessful = true;
ttfrmQuestions.SetToolTip(btnNextQuestion, "Advances to the next question of the quiz");
ttfrmQuestions.SetToolTip(btnPrevQuestion, "Goes back to the previous question of the quiz");
ttfrmQuestions.SetToolTip(btnHint, "Shows a hint to the question. The usage of a hint penalises you for 1 mark");
ttfrmQuestions.SetToolTip(btnSubmit, "Submits the answers to the server. You can only submit the answers once.");
}