VB.Net - How to scroll through GroupBox - vb.net

Please excuse my lack of familiarity with vb.net. Just got thrown on a project with no vb.net experience.
I have to add some things to an application that was written by somebody who is no longer in the picture. I have to add more textboxes into a groupbox and when I do that it exceeds the size of the form. How can I make it so that I can scroll through the groupbox?

GroupBox, as it doesn't derive from ScrollableControl, so itself can't have scrolling functionality.
So...
Place the GroupBox inside a panel, and set the panel AutoScroll to true.
Guides:
Adding a panel control
Setting properties (of anything)
Moving content is just simply selecting all the elements you want to move, and click and drag them into the new place.

You could set the AutoSize property of the groupbox to true, and then set the AutoScroll of the form to true as well. This should resize the groupbox so that everything in it is visible, and then the form will have a scrollbar. If you don't want to make your form have a scrollbar for some reason, then you could use a panel and set it's AutoScroll to True so that just the panel has a scrollbar.

Add a Panel with no border inside the GroupBox to group your controls (put the controls inside). Then:
Panel1.ScrollBars = ScrollBars.Vertical
Or even ScrollBars.Auto.

GroupBox doesnt have scrolling functionality itself. Most likely most simple solution here is to just put a Panel inside the groupbox and add the textboxes to the panel instead.

Related

Controlling the AutoScroll behavior on Panel

I have a set of controls inside of a Panel and set the AutoScroll property of the panel to True so I get the Vertical ScrollBar but when I slide the bar is not smooth and if some of the upper controls inside the panel have the focus the bar return to the top.
I read some about and found a solution on
smooth scroll with autoscroll
Which work Ok but uses a lot of resources, I see it on Windows Task Manager, one of the processors goes about 60%, so I think is something wrong with this.
There's another way to met the same goal?
I tried to put my own VerticalScrollBar unsuccessfully. :(

How do I scroll with the scrollbar?

I am currently working on a project in VB.NET and I have a fixed-border form with the AutoScroll property set to True. Under the Load event, I have some loops that add a bunch of controls to the form, so I have AutoScroll create the scrollbar for me automatically.
Now when I open up this form, all the controls load up with no problem, it focuses on my first text box, and the scroll bar shows up. However, the mouse wheel does not do anything whatsoever.
So my question is, how do I, no matter where my focus or mouse is, scroll with the AutoScroll property enabled, in VB.NET?
as far as i know, scrolling is only enabled when focusing the appropriate element. but should be able to trigger scrolling by catching onmouseover() or similar...
this is somthing similar (just for a datagrid) scrolling datagridview without get focus

Transparent Tabpage to show Desktop (wallpaper and Icons)

With winforms, you can set Transparency of a form via setting up the TransparencyKey and the Backcolor of the form into the same color in the properties window.
However, the tabpages in the TabControl doesn't have these properties.
How will I make it so that a tabpage will show the desktop's contents?
Also, is there a way for me to show the icons in my desktop on the tabpage? The icons must still function as normal(can be double clicked to open the file, single clicked to rename and can be dragged around inside my tabpage.)
I am using VB.NET 2005. Any direction is greatly appreciated.
Apparantly, the answer is quite simple.
Just set the TransparencyKey of a form to a color that you wish to appear as transparent, then set the backcolor of the tabpage to that color (the color you've set on your form).

Force Vertical Scrollbar to be Visible in Panel

I have a Windows Forms VB.NET application, with a panel that contains a few other controls.
I set the panel's AutoScroll property to True, and that seems to appropriately apply the scroll bars when they are needed. The issue is that a user must scroll all the way to the right to access the vertical scroll bar. Is there a way to always show the vertical scrollbar no matter where the user is scrolled horizontally?
EDIT
I guess the main problem I have here is that I have a DataGridView inside of a panel. I want the panel to do the vertical scrolling, and not the DataGridView. Why is it when I turn off vertical scrollbars on the datagridview and have autoscroll on the panel, a vertical scroll bar is never shown?
You could add a VScrollBar on the right side of the panel and set code behind to move the panel scroll up and down.
or
A better option may be to switch your panel to a FlowLayoutPanel which provides quite a bit of control over the scroll handles both vertical and horizontal.
Check out MSDN and see how to use all of the properties of the FLP:

Why does hovering the mouse over a combobox make my tabpage re-paint itself?

I have a tabpage. And I have a combobox in it.
When I hover my mouse over it, my tabpage's paint function runs.
Why?
The Combobox has no functions handled. It is just a Combobox.
I move the combobox out of the tabpage, and now the tabpage won't paint when I hover my mouse over the combobox. Weird..
This isn't specific to a TabPage, the same thing happens when you put the combo on a form. It is affected by visual styles, the container paint requests stop when you turn that off. I'm guessing it has something to do with the rounded corners you get when the DropDown property is set to DropDownList, the combo glows on a mouse hover. With it probably asking the container control to draw the pixels in the corner. Explaining it for DropDown = DropDown is harder.
Same thing happens with a Button, the container control paint is documented in the Reference Source to support transparency effects. Even if the button doesn't have anything transparent. Visual styles is less than optimized like this, perhaps. It is otherwise very similar to what WPF does. Long story short, this is normal.