Controls size are different at Runtime - vb.net

I noticed the groupbox label is different at runtime, I tried some properties like anchor or autosize but it doesn't seems to work.
Image sample
How can I try?
Thanks

Eventhough I don't know if this is a workaround or the solution but I realized that Flatstyle property needs to be set to System. This way you can also center the text of groupbox.

Related

VariableSizedWrapGrid does not size correctly if control size modified in code

I am creating a UWP app and I am using the VariableSizedWrapGrid control. I am binding the Width of the a ComboBox in the grid to it the ComboBox width resizes based on the entries in the list. ( I am using a simple property exposed through my view model.) When I had the items in a StackPanel with a Horizontal orientation it worked fine. See picture below
The challenge of course is that on a smaller screen I need the fields to wrap around. So I switched the StackPanel to a VariableSizedWrapGrid. However, when I do that, the Grid does not seem to be handling the resizing of the ComboBox correctly as I get what is shown below. (See the ComboBox is now cut off
Any suggestions on how to resolve this would be greatly appreciated.
You are using the wrong Panel for the job. The one you're looking for is a WrapPanel (which doesn't exist actually though), but there are some implementations available, eg.: http://codepaste.net/8gr5go

Prevent User Control from being resized during runtime

I have problem in using user control in vb.net. Everytime I run the program the user control was being resized. Can anybody help me on how to stop the user control being resized during runtime?
I am looking for something like Locking the property of the form but it doesn't work.
Thanks in advance.
Your usercontrol has AutoScaleMode property. Try to check this property!
I had a similar problem. AutoScaleMode property in my usercontrol was default in Font. My font was 9pt, but the parent control had 13pt font. So the size of the controls in my usercontrol auto scales with ratio 13/9.
couple of things to check:
do you use docking? - it will resize following parent control if yes
do you use anchor? - it sometimes gives odd behavior too
some controls have AutoSize property, did you set it true or is it by
default true?
some controls have AutoWidthInLayoutControl, did you
set it true or is it by default true?
another try, some controls do have Maximum and Minimum size, set these values to your desired if necessary.

Animate TranslateTransform on GridViewItem

I have a series of items in a GridView.
I want to animate the TranslateTransform of a GridViewItem so that it is outside the boundary of the GridView. When I do, it is clipped. Is this type of transform possible?
Sadly, I don't think so. I had to do something similar a while ago and it turns out that the template of a GriView (and ListView, ListBox, etc...) contains a ScrollViewer control. The thing about the ScrollViewer controls is that they MUST define a clipped viewport to give the user the impression of scrolling. In fact, if you were to decompile the ScrollViewer control, you can see that it hard codes the clipped bounds, so you cant even change the template or style.
Things may have changed since I looked into this, and my investigations where on WPF not XAML in Windows 8, but I dont think that it would have changed based on your description of the issue.
Here is a SO question in relation to this topic: WPF clipping even when no clipping is desired - how to turn it off?

Winforms border style

I am trying to make a form with a border like the border on the Windows Vista volume control. The form would need to be resizeable as well.
Thanks, giodamelio
To be a little more clear about what I am looking for.
Here is a form with the ControlBox property set to false.
Here is a rough Photoshop of what I am looking for.
Set the forms .Controlbox=False
Set the forms .Text=""
Done.
You can enable in your Projectsettigs "enable XP-Visual Style".
If you launch your application now, you should have the default borderstyle of the launched OS
Try setting the FormBorderStyle to None or Fixed(3D|Single) and work from there, perhaps.
Alternatively, setting the ControlBox to False should also have the effect of hiding the title bar. However, beware that the form won’t update automatically:
If you set ControlBox to false, and also set the Location property, the Size property of Form will not update to reflect that the non-client area of the form has been hidden. To fix this problem, put the code which alters the Location property to the HandleCreated event.
One way achieve this by following steps:
Set FormBorderStyle of your Form to None.
Take a PictureBox, set its Dock Property to Fill.
Take a image containing Border, and set this Image to the PictureBox.

VB.NET: label vs picturebox

What is more lightweight control, a label, or a picturebox? (label can contain image too).
I will have a form with 110 icons displayed in separate controls and I'm deciding if I should display them in pictureboxes, or a labels.
In VB6, there was an Imagebox control which was MUCH more lightweight than picturebox. What is the most similar control to Imagebox in VB.NET?
Thanks! :-)
Although I know it's not part of your question, the real problem it seems you are experiencing is the fact that you have 110 icons in a single form. I would take a look at the UI and see if there is a better way to lay it out or design it so you don't have to worry about whether or not to use one component vs the other.
I don't think you can compare them because fundamentally they are so different--VB6 controls versus .net framework controls that is.
Take a look at the class hierarchy in .net and you will see that both picturebox and label derive from the same set of classes.
While I didn't itemize the classes' properties and methods, I would guess that the only difference between a Label and a Picturebox is that there is a text property for a Label box thus alleviating you of rendering your own text if there were no Label control and all you had was a PictureBox.
Both a Label and a PictureBox can be assigned an Image object or work in conjunction with an ImageList. So if all you are looking to do is display images then the PictureBox should be just fine (not to mention the fact that it clearly conveys the control's purpose in life: PictureBox:Icons::Label:Text).