[C#] Does anyonw know how to fix this?

Started by ForeverZer0, April 26, 2011, 11:04:56 pm

Previous topic - Next topic

ForeverZer0

April 26, 2011, 11:04:56 pm Last Edit: April 26, 2011, 11:12:50 pm by ForeverZer0
Okay here's my problem, look at the first picture:

A normal window proportioned nicely.
Spoiler: ShowHide


Now, I form set to allow the user to resize it, but the result is not what I want. The bottom group box is the only one that appears to stretch. The others actually do, they are just cutoff. Here's what I mean:
Spoiler: ShowHide
 

My question is does anyone know a way to have it behave properly without manually having to code it by calculating height and coordinates, etc.?
Is there a setting I am missing?
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

G_G

April 26, 2011, 11:17:26 pm #1 Last Edit: February 18, 2013, 03:23:27 pm by Ryex
Turn the Top anchor off for the middle and bottom group boxes.

EDIT:
In return for helping you (whether it fixed it or not) you shall vote if you haven't already.
http://forum.chaos-project.com/index.php/topic,9454.msg142807.html#new

Need a few more votes before I actually decide and get started.

EDIT 2:
Eh, I realized that wouldn't stretch the boxes my bad....lemme think about it for a minute.

EDIT 3:
Where did you get that awesome skin? Is it your OS theme by chance or...?

EDIT 4:
This is probably going to be the easiest as far as I know.

Add an event handler for "Resized" for the Form or Tab control. Guess it doesn't matter.
Basically do this.
Code: cs
gb2.y = gb1.y + gb1.height + 4
gb3.y = gb2.y + gb2.height + 4

Probably the easiest.

Something along those lines anyways. And with this, you'll want the Top anchor on now.

ForeverZer0

April 26, 2011, 11:40:23 pm #2 Last Edit: April 26, 2011, 11:44:44 pm by ForeverZer0
That doesn't help, it merely makes it so that the top box is the big one. I messed around with about every conceivable combination of anchor settings before I posted the topic. I could make it work with two group boxes, but with three it screws everything up.

I think I'm gonna have to create an event handler for when the form is being resized, and calculate maximum height on the fly. There are a few settings I haven't played with yet, though I'm not sure if they are even related.

Google, here I come...

EDIT:
lol, you posted your edits while I was typing and experimenting.
BTW, I voted.
BTW, its a WindowBlinds theme "Precision", with a color edit. And if it makes you feel better, I just ruined my crack while checking the name of the theme. Now everything is back to normal. :(
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

G_G

Read my edits >:U

EDIT: Make sure the tab control gets resized if needed.

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ForeverZer0

I want the form to be able to be resized, that's why I set it that way. I just want the three group boxes to resize evenly, without the graphical error.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

G_G


ForeverZer0

Quote from: ForeverZer0 on April 26, 2011, 11:04:56 pm
My question is does anyone know a way to have it behave properly without manually having to code it by calculating height and coordinates, etc.?
Is there a setting I am missing?


I had already thought of that, just wasn't sure if I was missing a setting somewhere. I'm not even sure if its worth the trouble. Its a little more in-depth than simply adjusting the height and coordinates. The height does increase on all the group boxes, it just gets cut-off by the ones beneath it. The coordinates remain static because it is anchored, but if its not then the windows don't automatically resize.

I have one idea left I haven't tried:
1. Anchor all three group boxes to the top-left-right only, no bottom.
2. Set each to "Auto-Size", which makes them resize to fit there controls.
3. Use a manual event handler "on_resize" to increase the size of the list boxes by one pixel for every three that the form increases vertically.

This should make the group boxes resize I hope, and is probably the least complicated approach on resizeing them manually.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.