Controls change place and form size changes - vb.net

I have designed a form in VB.NET. At design time I have placed two buttons on it.
When I run it, the form size looks smaller and the buttons I have placed at the bottom are not visible. Also the alignment of the text and picture box is also different from what I set at design time.
Computer at which I am running the form is using a different resolution.

change the properties (F4) of the buttons: in ANCHOR put Bottom, Right
your buttons will be tied to the bottom and the right of the screen, instead of to the top, left, which is the default.

Grab the screen size at runtime with
Dim screen as System.Windows.Forms.Screen = System.Windows.Forms.Screen.PrimaryScreen
and using a scale factor depending on the current size (in design), scale the window to match. Check the coordinates of the buttons by hand to make sure they are not outside of the visible portion of the window.
You may not have to leave this feature in if you can debug it to the point that you know the exact resolution that you need.

Related

Make Form Maximized, but not Full Screen

I would like to make my Form1 Maximized, but not Full Screen, as differentiated by Maximized taking the entirety of the screen while leaving space dedicated to the Taskbar at the bottom. To clarify, I'd like my application to work how other applications traditionally work, such as Chrome or the MS Office suite when maximized. Definitely nothing fancy.
To make my application resize itself dynamically, I've calculated where buttons will fit relative to the height and width of the application. However, I discovered quickly that my application, in Maximized state, actually continued underneath the task bar (or, in reverse, the taskbar is entirely cut off by the application - it is Full Screen). My bottom-most buttons are actually cut off by the taskbar. After experimenting with different Form settings, I discovered this appears to be entirely the result of WindowState = FormWindowState.Maximized setting.
I've tried various routes to counteract this behavior. First, I attempted to resize the maximum bounds programmatically, while leaving the Form's MaximumSize set to "0,0" (the default "resize me as needed" setting). I have this code in the Form_Load event:
Me.MaximizedBounds = Screen.PrimaryScreen.WorkingArea
and
Me.MaximizedBounds = Screen.FromHandle(Me.Handle).WorkingArea
However, these did not have any affect, even though the working area height is confirmed smaller than the form height. In fact, upon further testing, I have not been able to programmatically change the maximizedbounds at all, apart from manually in the form properties, setting the MaximumSize to 100,100. Does anyone have suggestions here?
I also tried to change the WindowsState = FormWindowState.Manual and readjust the form height this way:
Width = Screen.PrimaryScreen.WorkingArea.Width
Height = Screen.PrimaryScreen.WorkingArea.Height
Which makes the form closer to the dedicated dimensions, but makes the window movable and no longer covers the entirety of a traditionally maximized screen (it leaves about 20 pixels padding on all sides).
In the end, I'm at a bit of a loss on how to do this and would really appreciate some clarification. I have attempted other code I'd be glad to share, as well as similar questions on the forum, but none have helped me get my targeted behavior. I have a locked Taskbar on the most recent update to Windows 10, if those details make any difference.

How to build below screen in titanium?

below i attached an app help guide screen. I am understanding how to build this screen.
If any body have idea please share here
View with semi transparent background color (backgroundColor:"rgba(0,0,0,0.5)";) and some images on top of it.
So, using images is bad. You'll need images for translations and if you do this as one image you'll need to ensure all devices are covered so your arrows point to the right element.
Minimise images == smaller app.
First thing you'll need to do is a create a blocker view -- so that's a view that will fill the screen and have a black background with opacity.
You can't apply that to the window as everything in it will be semi-transparent so:
Create a transparent Window that fills the screen.
Add to that window a view that fills the window and has opacity say 0.5 and black background
Add to the Window (not the view you just created) the other elements and button -- ideally, these should be individual graphics of the arrows, sized in such a way that you can position them based on the host element (the item they are pointing to / referring to). Use real text so you can handle translations / reduce file size.
So you'll need a way to associate each tip with a control they are anchored too, and that will ensure that regardless of the screen size, the tip will appear in the correct place.
First of all, always give a try before putting questions anywhere because it makes you learn things on your own for long time.
The easiest step for you to do this is to ask your designer to create a complete image just like that & you just have to show it on top.
If you have to show that image in different translations, then you can ask your designer to provide you required translations images.

vb.net unwanted richtextbox resizing

i have two richtextboxes of the exact same size located on my form. However, when I run it, one's height reduces. There are other controls around it so it leaves a weird space. What causes that?
Form in the Design tab
Form once I run it
I've tried constraining the control with the "same height" button, I've created a new richtextbox, but it keeps on happening.
It also depends on computers, on screens with unusual resolutions the box is the correct size.
Thank you
Its because scroll bar coming in picture. In order to uniformly set the positions and sizes of RichtextBoxes use DOCKING or Anchoring properly

VB.NET: Scrollbar "button"?

I plan on using a scrollbar for, well, scrolling an image. The image is 200x500, however, the only visible area is 200x250.
So I set the max value to 250, and the min value to 0. The idea is that if I drag the scrollbar's button to the bottom, 250 pixels will have moved for the image, right?
But wait, the scrollbar's button is.... very small. And the scrollbar is actually pretty long. Is there a way to make the scrollbar's button longer?
How did you create this scrollbar? Is it a separate control all together, or it is a component of another control? I do know that scrollbars added separately act kinda funny at times.
What I would suggest is using the scollbars built into another container control, which should achieve the exact same effect.
Create a new panel control on your form, and name it. (I suggest something like panelPicture)
Position the panel where you want your picture to be.
Set the panel's size to 200x250.
Set the panel's "Autoscroll" property to True.
Put a PictureBox inside this panel, and name it. (I suggest something like picMyPicture.)
Set the PictureBox's position to 0, 0.
Set the PictureBox's size to 200x500 (or whatever is necessary).
Set the PictureBox's Image property as desired.
Now, the scrollbar should automatically appear on the picture, and it should look normal.
As a side note (which may or may not be relevant), users typically don't like having to scroll to see the rest of an image, so if you don't need the user to scroll down on the image for some definitive purpose (or because you don't know what the size of the image that will be handled is), I'd try and change the size of things on your form so scrolling will not be necessary.
I hope this helps!

Grow / Zoom VB.NET Form

Is there an easy way to grow / zoom a VB.NET application and all controls within it to fill a larger screen resolution (or must I adjust each form element individually)?
NOTE: Adjusting the resolution back is not a permanent (or preferred) option in this case.
Please don't design your forms so they always fill the screen. Your customer has bought that nice expensive monitor to see more windows, not more of your form.
A well designed form is otherwise always resizable. Use the Anchor and Dock properties, TableLayoutPanel and FlowLayoutPanel to ensure that your controls move and size themselves properly. If your customer wants it big, she'll just click the Maximize button.