473,396 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help with custom form-sizing handles

HaLo2FrEeEk
404 256MB
I've been working on this program for quite a while, and I'm pleased with how it's turned out. I've released several versions, improving on the base concept every time, but I think things are starting to get a little too heavy and odd things are happening.

Basically, I've got a main form with a child form. The child form is nothing more than a single-pixel border with a handle in each corner, at each edge (centered to that edge) and in the center of the form. The handles are simple panels. When I hold the mouse on one of them and drag, it resizes the form from that handle. I did it this way because I wanted to see if I could, and I could. The thing that's bother me, however, is that when I move the top-left, top, top-right, left, and bottom-left handles, the form flickers...badly, especially toward the right and bottom edges.

I'm sure I know why this is. When moving any of those 5 handles, it causes the form to resize, and move (since sizing is done from the top-left, and moving any of those handles moves the top-left). I use a single method to reposition the handles when I resize the form (because I want the handles to stay in the corners/edges/center). I thought perhaps running the positioning method in a thread would solve the problem, but it didn't. I tried SuspendLayout()/ResumeLayout(), to no avail.

I don't remember this happening before, at least not this badly. I re-downloaded a previous build and it definitely didn't do it this badly. I'd really like to figure out how get this to stop. It's not app-breaking or anything, in the end the form does resize to the proper location/size, but it's just annoying to see the flicker while resizing.

Also, for the record, I tried turning on double buffering for my form, didn't help.

Is there any way I could turn these fake handles into actual resizing handles, like, enable hit-testing on them and catch the messages with WndProc?

Here's a source of the app in it's current state, there's a build in the bin/Release folder. It's messy since I'm in the process of doing some updates, so forgive me for that:

http://infectionist.com/extras/cshar..._1.5.1_src.zip
Dec 27 '10 #1
4 1586
HaLo2FrEeEk
404 256MB
Come on, please? I gave more than enough description what I want to do, please someone help me figure this out. It's been almost a week.
Jan 2 '11 #2
GaryTexmo
1,501 Expert 1GB
Once again, please be patient. In some cases people just don't know the answer. I took a look at this when you first posted and sadly, have no ideas.

There's nothing wrong with your question, but a lack of answer doesn't mean we're ignoring you, it means we don't know :)
Jan 6 '11 #3
HaLo2FrEeEk
404 256MB
I ended up using the Bounds property to save myself from setting the Location and Size properties separately, that solved the problem for the most part. I also did away with the constant repositioning of the handles with every move event, now I only position them in the beginning and let Anchor work its magic. Things are much smoother now.
Jan 6 '11 #4
GaryTexmo
1,501 Expert 1GB
I'm glad you got it figured out! :)
Jan 6 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: KS | last post by:
Hi, I have creatd a custom Outlook form with a few custom form fields. When completed the form is sent to me and goes into my Inbox. This works fine. Now Iam trying to write some code in...
1
by: Ben | last post by:
i'm having trouble getting a custom validator to fire on one of my webforms. i dragged a custom validator onto the form, left all the properties on default, double clicked it, and typed this in the...
3
by: Wade | last post by:
I am having an issue where I have added a custom property to one of my forms, but it doesn't show up in the properties window in the designer window. The property shows up in the intellisense in...
2
by: TD | last post by:
I've read several posts here that say global variables are reset whenever an unhandled error occurs. I want to use a custom form property instead of a global variable to store a boolean value. My...
4
by: ThunderMusic | last post by:
Hi, I have a borderless form and I try to drag it. When I do it, the form start to jump from position to position even when I don't move the mouse... My formula seems right, but the result is...
2
by: rdemyan via AccessMonster.com | last post by:
My application has a lot of complicated SQL statements, calculations, processing that takes time. I've created a custom form to act like a messagebox. It has 10 small rectangles on it that change...
4
by: ThunderMusic | last post by:
Hi, I have a custom form that works fine when I debug it or run it in release mode but cannot be loaded in the designer... Actually, it can be loaded in the designer when no control is on it, but...
4
by: Yo mama | last post by:
Hi! I have problem using simple custom form control on asp.net page. It does not do much. Just label and button. (It is for training purpose). My control works fine when I use it in my windows...
0
by: shivapadma | last post by:
Hi, I have problem Regarding the Sales Order Form Customization 1. Downloaded the original Sales Order For(OEXOEORD) and saved with different name say(OEXOEORD_CUSTOM) 2 moved to the...
2
by: DragonLord | last post by:
I have a custom form that launches from a button. The form works great with a little hick-up. When you open the form the onmousedown does a check to see if the click from the mouse is on the form...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.