Programmatically know if a control (or empty cell) is merged in Access Form - vba

I'm working with MS Access VBA, an I have an stacked design in a form (the yellow grid).
it's possible to know (programmatically) if a control (or empty cell) is in merged cell or not?
Thanks.

These are not cells, these are controls (labels, textboxes, comboboxes, etc). Controls are not merged. What you see is a grouped layout. Controls are associated as a group and controls will move together if you grab and drag the box in upper left. Resize width of one control and you resize all in same "column"; resize height and you resize all in same "row". Forms and reports built by Access wizards default to grouped layout. To remove grouping: select a group > right click > Layout > Remove layout.
To determine the layout type of a control, reference its Layout property.
Me.controlname.Layout
0 = not grouped
1 = tabular
2 = stacked

Related

VB.NET flowlayoutpanel list of wrapped contents in one column

I'm struggling to figure out how do I make a flow layout panel that has strictly just one column and upon scrolling it adds the controls at the bottom of that column and not make a new column and so on while having it wrap the controls. I can get that If wrapcontents = false. For some reason in my case the scroll bar appears horizontally at the bottom and not vertically at the right side.
How do you make it as explained?

How to grow all controls within form

I'm having difficulty with resizing controls in two panels...
I have a form with two panels stacked on top of each other. The top panel takes up 38% of the form and the bottom panel takes up 58% of the form and a 4% gap between.I have a tab control in one and group box in the other.
I've been trying to perform fills/docks within the panels that will cause all controls to grow and shrink with the panel's size. In other words I'm trying to keep the same space and size percents for all controls based on the form size. Visual studios keeps crashing when trying different fills/docks and I don't want to calculate size percents and x/y coordinates for each control. Is there a way to set up the fill within the panel or container so that it looks almost the same at most sizes?
In my experience, docking causes more problems than it helps. What I do instead, is undock the controls and then anchor them on all sides. Then I size them within the panel how I want them. Then, if the panel is ever resized, the controls anchored within them will resize accordingly and it will stay within the boundaries like I want it to. Try that.

Using the Form Scrollbar to Control Image Transparency in Excel VBA

I'm struggling in making a form scrollbar to control the image transparency. To be specific, I've got two images that I'm linking to two buttons. Hide/show buttons, and I want the scrollbar to control the image transparency as shown in the image below. Your help would be appreciated. I can't wrap my head around to code it.
Here is a low-tech approach.
1) Create a rectangle and fill it with your picture. This doesn't require any VBA.
2) Insert the scrollbar and, using the properties, link your scrollbar to a cell with the default 0-100 range of the scrollbar's values. For example, in the following picture I linked it to J20:
Then, in a standard code module put:
Sub SetTransparency()
Sheets(1).Shapes("Rectangle 1").Fill.Transparency = Sheets(1).Range("J20") / 100
End Sub
(With of course things like Sheets(1), "Rectangle 1" and "J20" to be adjusted to match your situation)
Then - all you have to do is right click on the control and select Assign Macro to assign this macro to your control. It can be used like:
Possibly unfortunately (depending on your desires) the transparency doesn't change continuously as you scroll. AKAIK, you would need to use Active-X controls for that.

Increasing the space inside a windows form

I am trying to populate my windows form with new controls and data based on what is read from my database. The left side of the form is a static panel which will not need re sizing but I need to create multiple labels on the right side which requires more space. I added the vscroll control but am having trouble increasing the size of the right side of the form.
To use a scroll-bar will require a semi-low-level implementation where you need to always update the view by repositioning the elements, calculating your scroll-bar in relation to total view, what elements would be visible and so forth.
A better solution in this case will probably be to add a Panel control on the right which is docked (f.ex. Fill) and then set the AutoScroll property to True.
This way you leave all the "low level" stuff to the Panel control and you can add and position the elements you need to the Panel's Controls collection instead.

Grouping Controls in Pairs vb.net windows.forms - Dynamic List in grid format

I have pairs of controls: immagebox + textbox = one pair.
I want these to show up in a single column grid/tabular format. Each cell contains one image/text pair.
I want this grid to scroll because the number of pairs is dynamic depending on a user selection.
I suppose I will be adding these controls in code at runtime when the user makes his/her selection.
What is the best way to accomplish that in vb.net? TableLayoutPanel or better way?
One possible approach is the following.
Use a Panel as your container. Inside this Panel you can add a TableLayoutPanel that is defined to be AutoSize=True. Add two columns to your table layout and then add controls in rows as needed. The TableLayoutPanel will then size itself automaticlly depending on the contents.
Now make your Panel be AutoScroll=True and it will automatically add the correct scrollbars so the user can move around and see the contained set of controls.