Search
Get Started
C
C#
❔ Dynamically change position of checkboxes?
Original message was deleted
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,010
Members
View on Discord
E
ero
•
6/14/23, 12:53 PM
i
'm guessing this is winforms
? use a TableLayoutPanel
E
ero
•
6/14/23, 12:58 PM
you don
't shift the columns
, no
E
ero
•
6/14/23, 12:58 PM
you rarely ever want to use absolute values
E
ero
•
6/14/23, 12:59 PM
with a tlp
, you can set the column widths and row heights to auto
E
ero
•
6/14/23, 12:59 PM
which will make them adjust to what
's currently inside of them
E
ero
•
6/14/23, 12:59 PM
you can add a margin to each cell
(or maybe to what
's inside of it
? don
't remember
) to have some extra space
E
ero
•
6/14/23, 12:59 PM
maybe you need to use padding instead of margin idk
E
ero
•
6/14/23, 1:00 PM
if you then set the visibility of the groupbox to hidden
, the column will adjust accordingly
E
ero
•
6/14/23, 1:03 PM
sure
E
ero
•
6/14/23, 1:04 PM
that
's a tlp with 2 rows and 2 columns
, where cell 0
,0 contains another control
(a panel
, or another tlp
) that has its columnspan set to 2
E
ero
•
6/14/23, 1:09 PM
uhh
E
ero
•
6/14/23, 1:09 PM
i don
't remember
E
ero
•
6/14/23, 1:09 PM
i personally would have put another tlp into that cell
E
ero
•
6/14/23, 1:09 PM
with 2 rows and 1 column
E
ero
•
6/14/23, 1:09 PM
and just stacked the checkboxes like that
E
ero
•
6/14/23, 1:12 PM
what do you mean
?
E
ero
•
6/14/23, 1:13 PM
you seem to have made a mistake
E
ero
•
6/14/23, 1:14 PM
you
're not meat to make the entire table 2 rows high
E
ero
•
6/14/23, 1:14 PM
you put another table
(or grid
, if that makes more sense to you
) into one of the cells
E
ero
•
6/14/23, 1:14 PM
basically splitting only that one cell into more cells
E
ero
•
6/14/23, 1:15 PM
the same
can
be achieved by making the entire grid 2 rows high and simply giving all other controls a rowspan of 2
E
ero
•
6/14/23, 1:16 PM
rowspan and columnspan basically meaning how many that specific control occupies
E
ero
•
6/14/23, 1:16 PM
yup
E
ero
•
6/14/23, 1:16 PM
and now you need to play with the docking and anchoring of the controls
E
ero
•
6/14/23, 1:16 PM
again
, try to use absolute values as little as possible
E
ero
•
6/14/23, 1:17 PM
this will allow you to resize your window to your heart
's content
, too
E
ero
•
6/14/23, 1:17 PM
this does mean that you need a
"root
" tlp as well
E
ero
•
6/14/23, 1:18 PM
it
's a little more awkward at first than just dragging and dropping your controls normally
E
ero
•
6/14/23, 1:18 PM
but your UI will actually be resizable and reactive
E
ero
•
6/14/23, 1:18 PM
the labels in the statistics groupbox i would make a tlp as well
E
ero
•
6/14/23, 1:19 PM
but maybe you don
't need to
E
ero
•
6/14/23, 1:19 PM
if it
's a fixed size anyway
E
ero
•
6/14/23, 1:20 PM
for the columns that plot type
, data point start and data point end are in
, i
'd go with some percentages
E
ero
•
6/14/23, 1:20 PM
padding to position
?
E
ero
•
6/14/23, 1:20 PM
oh
, misread
E
ero
•
6/14/23, 1:21 PM
i would anchor the checkbox left and right
E
ero
•
6/14/23, 1:21 PM
E
ero
•
6/14/23, 1:21 PM
taken from google images
E
ero
•
6/14/23, 1:22 PM
just not top left
, but left right
E
ero
•
6/14/23, 1:22 PM
that will center it vertically in the cell
E
ero
•
6/14/23, 1:22 PM
on the checkbox control
E
ero
•
6/14/23, 1:23 PM
i suggest sorting your properties alphabetically instead of by category
E
ero
•
6/14/23, 1:23 PM
E
ero
•
6/14/23, 1:23 PM
E
ero
•
6/14/23, 1:23 PM
here
's an even better google image lol
E
ero
•
6/14/23, 1:24 PM
pretty sure that controls the text position
?
E
ero
•
6/14/23, 1:25 PM
anchor on all 4 sides
E
ero
•
6/14/23, 1:26 PM
ah
, alright
E
ero
•
6/14/23, 1:26 PM
try dock
E
ero
•
6/14/23, 1:26 PM
can never tell the 2 apart
Next page