Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have three windows forms like below images. I want to combine all three forms into one form. Which I can show fullscreen application as a one window
I can't use only one form with all the code. It has to be something like this three forms combined into one full-screen form. Is there a way to combine them?
You can do this by MDI Container
FormA formA = new FormA();
formA.IsMDIContainer = true;
FormB formB = new FormB();
formB.MDIParent = formA;
formB.Show();
FormC formC = new FormC();
formC.MDIParent = formA;
formC.Show();
and then run
formA.Show();
look at this article
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
So I'm trying to make something and I know how to make topmost but how do I make it where from another tab like a settings tab make the main topmost but the check box is in a different tab then the one I want topmost?
here is the code I use for just being on the same tab.
if (!TopMost)
{
TopMost = true;
}
else
{
TopMost = false;
}
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm creating a little game with windows form app. in this game the user have 5 tries.
so I want to show remaining tries in a picture box.
for example:
at the beginning the picture box image is show num5 icon.
when the user click the button the picture box show num4 icon and so on.
what can I do?
You can call this method each click :
// it's global var refers to image
int count = 1;
// use count to load the next image
void loadNextPic()
{
string picPath = "../Pics/imageNum" + count.ToString() + ".jpg";
pictureBox.Image = Image.FromFile(picPath);
count++;
}
Remember you need to name the images as "imageNum1.jpg", "imageNum2.jpg" and so on.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Let's take an example of what i want. If i have a form in C# and i want this form design and action varies according to some files say XML files sometimes this form has a picture box and button do something, sometimes this form has some labels, buttons , panels do something else according to the external file given to the program. may these files has form styles, controls, action??
How is it possible to do that and if it is possible how to do it??
By reading from an Xml file, this can be achieved.
You need to have a FormDesignManager which should be able to parse the xml and create the form put all the controls and return the form.
publci class FormDesignManager
{
public static Form CreateForm(string xmlPath)
{
var form = new Form();
//design the controls for the form
//you can get System.Windows.Forms.TextBox or any other controls from the xml
var control = typeof(Control).Assembly.GetType("System.Windows.Forms.TextBox", true);
var textBox = Activator.CreateInstance(textBoxType);
return form;
}
}
Please, see this C# Create Control From a String Value
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a main form, and call ShowDialog method (form2). After 2', application will logout and show form login. I want to close all form showing.
Application.OpenForm will be useful
foreach (Form f in Application.OpenForms)
{
if(f.Name != "MainFormName")
{
// don't close main form
f.Close();
}
}
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Below is my code
private void btnCptKb5_Click(object sender, EventArgs e)
{
Form1 form1 = new Form1();
textbox1.text = form1.textbox1.text;
}
Why is that I can't copy the value of form1 textbox?
You didn't change Textbox2.Text value
You are creating a completely new form instance,and trying to access that form's textbox value.It will be always empty even if your code works.
I think This question is most commonly asked question in StackOverflow You can take a look at these questions, and I'm sure you will find an appropriate answer:
1) How to pass values between forms in c# windows application?
2) Passing data between forms
3) switching between forms without loss of information
4) windows.form c# moving between forms
5) Communicate between two windows forms in C#
6) How to share data between forms?
7) Passing Data Between Forms
8) Get data from one textbox on form1 from another textbox on form2