Autosizing form to stop controls from overlapping - VB.NET - vb.net

I am currently designing a form for my business - but struggling to implement a feature.
The image below is of the bottom half of a form - I had to blur/remove quite a lot for data privacy reasons. There are two group boxes here (one on the left and the other on the right).
The blue area is a tool strip. The greyed out areas represent apps. The application itself is basically an app launcher that allows the users to add apps to the tool strip.
Right now I've set the tools strip's LayoutStyle to Flow and the AutoSize to False
This means that when there are only enough apps to fill one row on the tool strip, it all looks fine, with some space between the bottom of the GroupBoxes and the top of the tool strip
However when I add enough apps that there needs to be two rows on the tool strip, the tool strip expands to two rows (represented in the image).
This is what I want, however as can be seen from the image, the tool strip now covers up part of the Groupboxes.
So I think what I want is for the actual form to expand when the tool strip expands, maintaining an same distance between the bottoms of the Groupboxes and the top of the tool strip.
Can this be done simply by setting some properties, or is there a way to do this programatically?

Related

'Pause' Display while control elements are updated (VB.Net)

So, I am kind of asking a question for a hypothetical situation here.
I am producing a Windows Form App made to show multiple windows of data on the screen at the same time. To accomplish this, I have decided to put a Table Layout Panel in the main form to act as a container for all of the data windows I will open.
The width and height of each cell of the Table Layout Panel will change depending on how many windows are open. For example, if just one window is open, it takes up 100% of the width and height of the container area. Alternatively if 3 windows are open, all the windows will have a size equal to 50% of the container's width and height.
Now let's assume each of these Windows have 20 different control elements, which are all used to help the user search through the data shown in each window. Additionally, all of these elements dynamically resize and relocate themselves as the dimensions of the window they are in change.
With all of these moving elements, when a screen is added or removed it can be assumed that there will be a good deal of glitching going on on the screen that may alarm the user. Thus we get to my question.
Is there a way to 'pause' the display of a Windows Form Application so that the user doesn't see everything on change modifying itself? I can't seem to find anything like while looking online so that is why I am asking here.

Transparent message boxes in VP UML?

I'm making sequence diagrams for a project I'm developing. Nothing overly complex, just a few lifelines with calls back and forth.
The problem is, the white background box of my message descriptions cover over things like my lifeline boxes and dotted lines when in close quarters. You can see the issue in the image below, though I tried to space them out enough to minimize it, the background box still bleeds over the blue lifeline boxes.
I tried checking out Styles > Formatting when right clicking the message, but transparency doesn't seem to have an effect. If I understand right, the transparency slider I see only applies to the border of the box, and when I click "Background" instead of "Foreground" I see a different view with no transparency sliders, only a list of colours.
How can I make the backgrounds of these messages transparent as well?
You can right click on the blank area of your diagram and select Connectors > Paint Connector Through Label to make the caption become transparent.
You can also find the same option under Window > Project Options > Diagramming > Connector which will take effect to any diagrams you created afterward.

What technique will I use if i want to change this panel when I click a button in VB

I just have it in my mind. And I can't explain it so here it goes.
A system that only uses 1 form?
It have a two panel, left and right.
The left is consist of buttons
Then the right is associated on the buttons and will change whether what button will be clicked.
Any ideas?
My preference is to do this via custom controls, rather than panels... but panels can work too.
There are a number of ways to do this:
Keep all of the controls layered on top of each other, and then set the Visible property to false for controls/panels you don't care about and to true for the Control/Panel that you do
Move the controls you don't care about out of the visible area
Remove/Add the Controls/Panels from Form's controls collection entirely
I think you can also get a TabControl to put the tabs along the left side, with some formatting that looks more like buttons, such that what you want will be handled without needing to write any code to switch layouts
Any of those can work. Whichever option you use, I have two recommendation for controlling layout and making the transitions smooth.
Call SuspendLayout() before making any changes, and then call ResumeLayout() when you're done. This will help avoid stuttering or a partially rendered form.
Look at the TableLayoutPanel Control. This control will allow you to arrange your top-level panels so that they can be resized with proportion. If you also then dock your individual panels, you can quickly build your program so that it resizes correctly.
You can have several panels, one on top of another. Change their visibility, depending on which one you need at a given moment.
Option #2 would be using a vertical tab control (or a tab strip - see another answer there).

Automatically adjusting winform and controls to screen size

I created a winform application. The size of each screen is 1361, 768 in pixels. This worked great for larger screens and/or laptops. But now I have to move my application to 10inch screen tablets, which means my application does not fit.
I have never had to deal with this issue before, how can auto adjust each form size and adjust all of the controls and panels when viewing on smaller screens?
I am using VS 2012.
Making forms fully scalable in WinForms is possible, but it takes a bit of work. The good news is that most of this work is done at design-time, arranging the controls properly so that everything is done for you automatically by the framework. It's drudgery, but it isn't difficult. Rejoice that you don't have to write the scaling code by hand, form-by-form, like you did with VB 6.
There are four fundamental properties that you will need to acquaint yourself with:
Anchor
Dock
Margin
Padding
The last two should be quite familiar web developers who know CSS—they do the same thing here. Padding controls the inner margin around a control, while margin controls the outer margin. You will need to set these correctly to ensure that your controls can "breathe", because the automatic scaling code is just going to jam them up against one another.
The "standard" margins around a control in a Windows desktop application are approximately 12–15 pixels. You should make sure that you leave at least this much room. Then add additional margins/padding as you see fit to separate things. I keep these layout specifications bookmarked for reference. This is another good reference.
The next step is to instruct the layout manager how you want the controls to be arranged and resized. The key to this is to think in terms of container controls and child controls. The form itself is a container control, and you can set its child controls to either Anchor or Dock within its boundaries. One or more of those child controls can itself be a container control, and its child controls can be Anchored or Docked within its borders. The nesting is virtually unlimited, but for your own sanity and reasonable redraw performance, you'll want to keep it to a reasonable minimum.
A good way of doing this is to use the two provided invisible layout helpers, FlowLayoutPanel and TableLayoutPanel. Personally, I don't find the former very useful very often, at least not for standard Windows applications. But the TableLayoutPanel is invaluable.
Generally what I will do is fill my entire form with a TableLayoutPanel (margins = 0, dock = fill). Then I will add individual controls (or sometimes another nested TableLayoutPanel) to its cells. Those child controls will have their margins set appropriately, and will have either their Anchor or Dock properties set, depending on whether I want that control to have a fixed size or resize dynamically.
Before you get the hang of how these properties interact and how it all works, you'll probably need to play around with your layout a bit. Make a backup of your forms and then just dig in. Or, you might find it easier to start designing each form from scratch (you can still copy-and-paste individual controls in order to preserve their other properties). Eventually, it will all start making sense to you, and you'll be up and going in a jiffy.
The great thing is, once this is all set up, all you have to do is ensure that your form is resizable. Then, whether the user manually resizes it or uses the maximize/restore button, it'll automatically fill their screen size. This also works well for all DPI settings, which is another common Achilles' heel of WinForms devs.
Try to get the resolutions variables to adjust your screens, there is an answer to get these variables using the Screen class
Getting Screen Resolution
DevExpress has a great control call the Layout Control. This control helps to maintain consistent whitespace between controls as the form is resized. It does take a little study to use the control effectively but once you understand how to use this control the results are consistent and you are able to speed through form design.

UIWebView paragraph selection style

as you can see in the first picture ,i'm using the UIWebview in my app.
But when i drag the second handle to the next paragraph , the selection become a rectangle box , i can only select the whole paragraph , how can i keep it just like the first picture?
from reading Using Copy, Cut and Paste Operations, you can see that iOS has implemented the UI selection for UIWebView, UITextView and UITextField for you, and thus what you are seeing is simply how selection works in these UI objects.
(and it is thus: so long as the user is within the bounds of a paragraph, then the user will be able to select a portion of the text in the paragraph as you have demonstrated in your first view; and if the user's fingers run beyond the edges of the paragraph, the underlying UI code showing the selected area will attempt to select the smallest subset of items it can select, with entire paragraphs being considered an atomic unit at this level.)
given that the documentation referenced above describes only how to invoke the various cut/copy/paste/select actions when invoked from a menu (with some control over what appears in the UIMenuController's menu, and some control over what you can do with the cut/copied selection in a UIPasteboard), there doesn't seem to be a handy way to direct how the UI responds to the user controlling the edge of the selection. even going so far as extending UIWebView might give you the ability to capture the touch events necessary, but you wouldn't be able to direct the resulting drawing of the selection through documented API of UIWebView.
and so, without mucking with non-public API, it's a little hard to imagine how you could have a more precise fine-grain control over selecting text spanning paragraphs unless you go to the length of implementing your own class to capture the touch-events necessary to control he selection and then process the events to draw the selection around the edges that you prefer. in other words, you'd sort of have to re-invent UIWebView and all that it does, with the exception of your special code for selections spanning textual paragraphs.
sorry.