❔ Responsive UI in winforms

Hello. I'm trying to make my first responsive UI in winforms. In terms of width, everything seems to be responsive (except the header but that should be an easy fix). The only thing I need help with and couldn't figure out myself are the big gaps (made them appear pink to make it clear) between header and the table below. The height should not increase for the row in the center. Thanks in advance.
45 Replies
Omnissiah
Omnissiah2y ago
well, what's the configuration of the control
IntoxicatedCookie
I'm assuming you mean the pink row in itself with control?
IntoxicatedCookie
I think this is the most relevant config as to that
Omnissiah
Omnissiah2y ago
why is this not docked how are you changing its dimensions
IntoxicatedCookie
using anchors it's not docked cause none of the options apply here. It should not stick to the top or bottom and the other option left would be fill and then it just fills the entire window.
Omnissiah
Omnissiah2y ago
😬 yeah i see it now it's late and im tired
IntoxicatedCookie
idk man, I'm new to this and yeah. I'm sorry if I'm making some rookie mistakes here But I wanna learn
Omnissiah
Omnissiah2y ago
to me seems you are not using enough panels, as a first impression
IntoxicatedCookie
The row is one big panel and the 3 censored blue boxes are panels in itself as well the table below and the header aren't though
Omnissiah
Omnissiah2y ago
because of this:
and then it just fills the entire window
and then it just fills the entire window
IntoxicatedCookie
Maybe if I make the header and the table on the bottom panels then it won't
Omnissiah
Omnissiah2y ago
to me this sounds like a job for a grid or for a splitpanel if you use a grid you could maybe avoid the "pink" panel
IntoxicatedCookie
Yeah I was looking for a grid but the only thing I found was the DataGridView and that seemed wrong
Omnissiah
Omnissiah2y ago
by grid i meant table layout panel
IntoxicatedCookie
Ah right Yeah I tried that too before but I can't have multiple items in one box E.g. the header consists of a banner with a button on top of it It didn't allow that
Omnissiah
Omnissiah2y ago
the banner would be the blue thing at the top? i see browse and home aren't those two buttons?
IntoxicatedCookie
yeah so the gradient is the banner and then, indeed, 2 buttons But I only tried with the home one and it didn't allow that
Omnissiah
Omnissiah2y ago
to me it seem solvable with another container
IntoxicatedCookie
plus the browse button is in a panel along with text that isn't visible on the screenshot
Omnissiah
Omnissiah2y ago
you put a container like split panel in the table layout panel's first row split panel will hold the two buttons and the background (gradient)
IntoxicatedCookie
Right so I'm assuming this is called SplitContainer in the toolbox?
Omnissiah
Omnissiah2y ago
yeah you make it fixed size, let's say and change other cosmetic stuff but it's the one or you could use another table layout if you have more hidden stuff i don't know
IntoxicatedCookie
Yeah I'm sorry about that but there might be mutual people in this server that could view this and shouldn't view it haha
Omnissiah
Omnissiah2y ago
right now vs is not really working great so i can't really go look names it doesn't show me some controls, don't know why i mean hidden stuff not as in censored but as in architectural
IntoxicatedCookie
ah right yeah there's a lot going on in the UI doesn't help that the responsive UI wasn't built from the beginning but I had to implement it afterwards
Omnissiah
Omnissiah2y ago
ui is not easy, i'll give you that you really need to put component into component to manage all the f** properties correctly but when it works... it's good
IntoxicatedCookie
yeah no it isn't. In terms of functionality, things are great but I got told to make it responsive right when things were about to be finished
Omnissiah
Omnissiah2y ago
doing this stuff in xaml or for web is a lesson in this sense because once you learn that way of building stuff you don't go back on older ways in the beginning it's cussing
IntoxicatedCookie
In fact, I started with web development and I know CSS but this needed to be a desktop app And I didn't feel like doing it in Electron so WinForms it is
Omnissiah
Omnissiah2y ago
why not xaml
IntoxicatedCookie
Got no experience in that and didn't hear of it before
Omnissiah
Omnissiah2y ago
you could've then made the ui in html and loaded it with a browser component in the form ok i'll go to sleep, i've said enough stupid crap for today
IntoxicatedCookie
Right okay, I think I'll call it a day as well Might just not make it responsive and rebuild the ui in XAML in a later version then
Omnissiah
Omnissiah2y ago
why not, what do you still need to correct
IntoxicatedCookie
the pink row and 2 other forms would need to be made responsive as well
Omnissiah
Omnissiah2y ago
this form seems pretty doable don't know about the other two
IntoxicatedCookie
one is pretty similar, the other is a home screen which is pretty basic
Omnissiah
Omnissiah2y ago
then go for it
IntoxicatedCookie
Even after using a TableLayout with separate containers, it shows up as this when it's maximized
Omnissiah
Omnissiah2y ago
how did you size rows and columns to me looks like first row should be fixed and contain home and browse then you should have a row with three columns and the three thingies, don't know if height should be fixed and then row with one column (which would probably be a columnspan) which would be all the remainig size
IntoxicatedCookie
Aah yeah I basically just made 3 rows and didn't use more than 1 column The 3 boxes are fine but it's just the size between the top and bottom of the row containing those 3 is too big and it should be the same size in height after resizing the window Whereas now it increases both the height as well as the width of that row but I just need the width to change
Omnissiah
Omnissiah2y ago
ok but in a table layout you are imposing the size of the rows, in % like saying "this row should be 1/5 of the container" or "this row should be 150 px"
IntoxicatedCookie
Ah okay. I think I found those properties yeah Just one thing, I was wondering how I can make it so just one row has a column. Only the middle row should have 3 columns
Omnissiah
Omnissiah2y ago
you have to set rowspan or columnspan (which would be how many columns/rows the single object should occupy) (these properties are in the control inside the grid)
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server