Adjust images with window C# - c#

So, I'm basically new using WinForms in Visual Studio 2017
Probably this questions are already answered but I can't find how to do it.
I just want to make the window bigger, but the images adjusting while I do it, any advise?
I've doing this all with the Menu and Toolbox, so basically I don't have any code to show
Edit:
I found a way to adjust the image but it needs to be full screen with PictureBox and activate 'Parent Container', but it's not what I need

Related

Where i can find padlock image C# visual studio, or net

Where I can find that image? I want locked and unlocked. Are these default images implemented in visual studio?
Have a look at Visual Studio Image Library
Currently It will be a good choice to use PictureBox and upload images to achieve this purpose. Here are the steps:
Add PictureBox control.
Click the arrow in the upper right corner of the PictureBox.
You can click ‘Choose Image’ and select local resource to import the icon you need.
At last, you can change the size mode of the PictureBox to an appropriate size.
You can find the lock-icon and lock-open-icon online. If you don’t mind, please use these I found.

Adjust your boxes based on windows size in c#

I have been working on a project in c# and I have the starting box size pretty small around, 700px by 450px.
Everything looks great on that size but when I maximize it, all the forms and etc stay the same size and just stick to the corner of the window.
I am curious if there is a way to get the boxes to adjust accordingly to the size of the actual windows form so if they click on the maximize button it doesn't look weird.
I have looked quite a bit online and everything I have tried doesn't seem to work. Also I am using visual studio 2013.
Thanks for the help!
I'm not sure I 100% understand what's going on, and please excuse me if I'm just saying things you already know, but controls inside of forms can be anchored. This helps because--for instance-- if a control is anchored on all sides then no matter how the form they reside in is resized they will grow with it.
The anchor property is in the property window.
As far as forms inside of forms that you would just have to grab the size property of the mdi window and grow the child forms based on this.
You could use the resize event in mdi form to fire off an interface method that all of your child forms implement maybe?
Learn how to use the Anchor or Dock properties to position and size controls relative to their container in WinForms

Layout placement/design of a WinForms Application

I would like to create a GUI where the main panel expands him self only to the space available, and then if some of the tools 1 or 2 are activated they appear at the top right side and if other tool is started it would automatically displays below ht visible ones or at top of none is displayed...
And if possible the append function.
I think its possible to do this with a bunch of if statements to re-size the panels everytime something would change the window content but there must be an easy way to do this.
Is something similar to the workflow of visual Studio...
Right now im using Windows Forms but i think its possible to switch to WPF
So what I'm looking for is for tutorials,sites,guides or simple a call to pay attention to some options inside the visual studio himself to help me create what I'm trying to achieve.
Here is a mock up to a better understanding
http://i.stack.imgur.com/0vupi.jpg
P.S the only thing I managed to do is hide and make visible the tool panels, but the space is always occupied in blank, and they appear no at top or bottom but the place where i drop them even if i dock them.
If you're open to third party controls, Telerik makes a fantastic dock control that does exactly what you're looking for.
Another option would be Digital Rune Docking or Windows, which is free for non-commercial use.

c# express: where is my picbox?

I am not a visual studio programmer but I need to whip up a quick app to display an image and manipulate it's height and width using a slider. I've done the quick google and all of the information talks about using picturebox(picbox) as the image containing control but I don't seem to have a picbox control in my VS C# express install.
Should it be missing? How do I get it back or install it? What are my alternatives?
If you've looked carefully in the toolbox and couldn't find it, you may have accidentally deleted the icon. Right click on the "All Windows Forms" section header in the toolbox and select "Choose Items". Check the checkbox near the "PictureBox" control. It'll show up in the toolbox.
In WPF, you should be looking for the "Image" control instead.
It was that I was in a WPF project rather than a windows form project like Mehrdad pointed out

visual studio 2005 designer moves controls and resizes Form

When i open a form in visual studio 2005 (c#) the designer automaticaly resize the form and move/resize controls without touching the designer at all. The source file is changed and when i close the designer i'm asked to save the *.cs file.
I tried to look into visual studio options without any success.
any ideas?
visual studio setup or something?
thanks,
Tal
I have been working on this problem for most of today and found some interesting things: The main source of the problem seems to be relying on anchoring. If I use docking to position my controls, instead of anchoring, my problems seem to go away. I found a couple of blog posts from 2003(!), which detail how you might use docking instead of anchoring, and explain how anchoring can break the Windows Forms designer. It seems like this problem might be over 7 years old!
Here are the posts:
http://weblogs.asp.net/rweigelt/archive/2003/09/24/28984.aspx
http://weblogs.asp.net/rweigelt/archive/2003/10/17/32407.aspx
http://weblogs.asp.net/rweigelt/archive/2003/10/23/33181.aspx
This is due to AutoScaleMode-property. Your forms have probably been designed with a different DPI or Font settings than you have now in Windows display settings. AutoScaleMode-property has 4 different possible values : Dpi, Font, Inherit or None. In Dpi or Font mode, your forms and controls will be automatically resized depending on windows display settings.
So, set the AutoScaleMode-property to None in all your forms and controls and they won't be automatically resized anymore. Try to design your forms in order to let sufficient space in every controls so that text will fit even if text size is set to 125%.
I found a work around.
not sure what happens behind but i changed my display properties. and it works fine.
here is the sequence: display propertis->settings tab->advance.
in the the advance dialog i changed the "DPI Settings" from Large (120dpi) to Normal (96 dpi)
Had the same problem with controls anchored top, left and right within complex TabControls. The visual studio forms designer was increasing the width of all nested controls each time I would open the form.
I found a simple workaround thanks to this post. I simply added a panel to each tab and set their dock property to fill. All existing controls within the tabs were moved inside those panels. This works, even if the controls are anchored top, left and right.
Works at least for Visual Studio 2013 and 2015.
This is one you should live with. Even in VS2008 such things happen from time to time. It is mostly depends on form content (controls, positions, etc), and there is no option in VS to disable such behavior.
When you open your form in designer, vs runtime rebuilds visual appearance from code behind. And sometimes it made changes at this moment. Also when you are simply adding one control to form, designer fully rebuilds codebehind and resource files. This is well known issue, and seems that MS won't fix it, because they move in WPF direction.
So several points to simplify your life:
Move to VS2008, designer were more consistent, but still shuffle controls in .designer.cs file
Place your code in one of the source repositories, so if you accidentally saved such form, you can restore it from repositary.
Setting the form Min and Max size settings to the current size was a good work around for me. This prevented VS from resizing it.
I had a trivial form with few controls on it, where the OK and Cancel at the bottom were being shifted up as soon as the form was opened in the VS2013 designer. The same behaviour was observed in VS2015.
The accepted answer here of DPI did not solve the issue for me, nor were there any issues on the size of the form/padding/margins.
Removing the controls that are shifted and adding them back into the form solved the problem for me, as suggested by ptutt here:
Visual Studio designer moving controls and adding grid columns when form is opened
While I appreciate ryantum's suggestion and links of using docking [with panels], as also referred to in the link above with Roland's blog post here https://weblogs.asp.net/rweigelt/28984, with something so trivial I'd rather just make it go away with removing/adding back in.
I found locking the controls from the format menu was a simple and effective solution. VS2013
I had this problem with VS 2015.
I used dock panels with the controls that moved unexpectedly as their childs.
By default the controls will be aligned to the left, but you can change the orientation.
My buttons stopped moving.
I had this issue, too. Every time I opened the designer, every box with anchor "right" was moved about 20 Pixels to the left. Additionally, the bottom of every box with anchor "left" was about 200 pixels outside the form.
This form has many controls and should not shrink on smaller displays, so it was set to autoscroll, the form itself was smaller in the designer than the shown minimum size (historically...). I just set the size to the minimum size so that no scroll bars appeared in the designer and the anchors worked as expected without screwing up the postitions.
I read the first post from ryantm's answer which led me to the solution. Apparently it has something to do with the order .Net executes events such as setting the size of a form.

Categories