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 4 years ago.
Improve this question
so I'm making a chat room, and it has several different scenes. However, for maximum efficiency, I need to have a clean workspace. However, the start here:
First scene. Is hard to have in the background when I'm placing stuff around. I know how to hide it once it runs, but is there any way to keep it alive, but invisible when I'm editing?
No there is no that possibility but there are 3 others (second one i do not prefer and would NEVER use but it is possible)
So you want to hide some elements in editing process because you are doing something behind them. From picture i see that first one is some kind of login form. So these are solutions:
1. Creating another form
So most common and practical is creating another form.
Simply create form with right click on your solution explorer > new > Windows Form
Then call it with buttons
Calling:
NewForm nf = new NewForm();
nf.Show();
this.Close();
2. Temporary moving it off
So idea is to move controls to the side in editing mode and then when you run program you set their location by code with simply doing button1.Location = new Point(15, 15);
3. Using TabPage
Create TabPage with 3 tabs.
First one are buttons, Second is if user want to create third if want to join.
Add this to your tab so it looks better and have no buttons at top (to user swich tabs)
tabControl.Appearance = TabAppearance.FlatButtons;
tabControl.ItemSize = new Size(0, 1);
tabControl.SizeMode = TabSizeMode.Fixed;
Then on button go to specific tab and boom.
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
I am getting all of the local processes on the computer and putting them inside of a FlowLayoutPanel where you can click the process you want and attach to it.
The problem I am running into is cloning a button so I can put it in the FlowLayoutPanel.
The plan is to make a for loop and loop through the array I get containing all of the processes and make individual buttons containing the names for all of the individual processes that is currently running on the machine.
TL:DR
What is the syntax for cloning a button class?
I cannot find the syntax anywhere talking about cloning anything when it comes to windows forms.
There is no such thing as cloning needed for what you are trying to achieve - simply instantiate new buttons in your loop:
for (int i = 1; i < 5; i++)
{
// instantiate a new button
Button btn = new Button();
// assign the desired property value(s)
btn.Text = i.ToString();
// add it to your FlowLayoutPanel
this.FLPanel1.Controls.Add(btn);
}
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 4 years ago.
Improve this question
Which form element can do the following:
- I press the button, the "additional" part of the form unfolds to the right.
Once I saw something like that, but I do not remember where.
I try to do it with "ToolStripPanel", but it does not work ...
"ToolStripPanel" makes the "red" panel expand to the "blue" territory.
It does not suit me.
What element of the form to use so that the “red” was of a constant size, and the “blue”
part was unwrapped and rolled up so that the form would increase and decrease?
image - link
According to your image, you could use a SplitContainer but what you see is a 2-step action. First, remove the panel 2, then resize panel 1 to take the newfound space.
Another option is to gradually decrease the size of panel 2, hence giving the illusion of "unfolding"
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've just started building up a simple game in Visual Studio using c# (It is my first low difficulty game). As I open it , it shows me a background image and 2 buttons, "Play" and "Instructions."and I want the form to get changed as I click the play button and open a new menu interface , like : " Game Difficulty / Character Appearence "(those 2 are buttons) , with a new background image. When I click one of them, another menu, etc.
Can I create multiple designs( Form1.cs[Design1/2/3]) for my from and swap between them ? If not, then how can I do something similar ?
In my opinion, the easiest way would be to make each menu a "User Control" that is the size of the main form, and then you can add a user control for whichever menu you want to show up as you go along.
For example, in the solution explorer I would create a folder and name it "Menus". Then I would create a new "User Control" in there. Copy the Width and Height of the form it will be placed on and apply that to the new control. Then you can add in all the buttons and images you like. Once you're finished, in your main form, you can add the "main-menu" control you made in the designer. For any submenus you want, create user controls for them too. Then, if you want a submenu to show up, capture a click event for the button you want and programmatically add it to the parent form using FindForm().
Pretend that DifficultyScreenControl is the screen that shows up after I click a play button located in my main-menu user control.
Inside of a menu user control
private void PlayButton_Click(object sender, EventArgs e)
{
DifficultyScreenControl DiffScr = new DifficultyScreen();
this.FindForm().Controls.Add(DiffScr);
}
Also it is a good idea to either Dispose() or remove these screens one they can't be revisited again as it can free up resources being taken up by them.
Feel free to ask me questions or comment on things to change!
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
http://i.stack.imgur.com/Hi9Iz.jpg
i am trying to create a table in c# which should look like at example above and it should be usable in a loop. example: i have two variables called "text" and "author" big box belongs to text and right bottom box belongs to author. those variables available in a loop. what i want to is fill those boxes and make it compatible with loop. i managed to solve this with textboxes but i couldn't figure out how to make them stay under another one.
The easier way (that i am aware of) to do what you want is with an usercontrols and a flowLayoutPanel so we do it as follow
Create an UserControl
create it with panels or textBox in the way you want your table to be, i did like so
Create a flowLayoutPanel
put it where you like it to be and set those properties
this.flowLayoutPanel1.AutoScroll = true;
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowLayoutPanel1.WrapContents = false;
add as much table like UserControl you want in it the result should be as follow
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 8 years ago.
Improve this question
I'm trying to make like a container application where you can drag and drop files of any kind on the form and afterwards to be able to open it from there. I found some solutions where you can drag and drop files to a list view and you get it's path.. but is not how I want.. I want to have on my form in a panel or what ever is better like a shortcut of the file, an image or something to be able to see the file icon like is in explorer.
Have someone ever done something like this or point me to the right direction?
Set "Allow drop" property to "true" on your control and make use of Control.DragDrop event - it's exist on all controls, and it's invoked after drag'n'drop anything on anything(if "Allow drop" is true of course).
It this event-handler you can add new item to this or another control(ListView fits nicely to your needs), and for example to some "Dictionary" where you will store "Item and filename mapping".
Also you need to make handler for item click'ing - for ListView there a ItemActivate event. Inside this handler you can click execute default shell-action for this file by using Process.Start