I've got an inherited panel on my form which overrides WndProc() and catches the 0x84 (WM_NCHITTEST) message. I do some processing on it and I'd like to know if there's a way to send that message, along with the result that I calculate, up to the parent form that contains the panel. I looked into the API method SendMessage(), but all you can send is the message (0x84), lparam and wparam, not the result (unless I'm missing something).
Does anyone know a way I could do this? I want to use this panel to control the sizing and moving of the form. Right now I can size and move the panel just fine, as though it were its own window, but I need to send it up to the parent.
7 4995
This is out of my area of experience so I can only offer a general suggestion. Couldn't you also override the parent WndProc()?
I may be wrong, but I think the result goes into wparam and lparam somehow, doesn't it? To be honest, I've never used this.
Having said that, since this is within your app, why not set up some delegates to pass data to the parent form?
*Edit: err, it occurred to me that you might mean the parent class, if that's the case I have no idea. If you mean the parent form (that contains the control), then yes you should be able to use a delegate.
I could override the parent WndProc too, but it's not receiving the message, the panel is. I want to catch the message with the panel, calculate the result, and send it to the parent, so that when I resize the panel control, the parent form is resized as well.
The form contains the inherited panel, I access the parent with Parent.[property], but it sees the parent as a control and not as a form, so I can't access its wndproc or any other methods, or other controls.
Would it be possible to use SendMessage() to send it to the parent form and then do the calculations at that level instead?
Halo,
Like GaryTexmo mentioned this is a perfect place to use events and delegates to solve your problem. Have your panel create a custom event and delegate and then have your form hook into that event. When ever you catch the 0x84 (WM_NCHITTEST) message just raise the event.
Erm...I don't know how to do that. I know I can do Parent.Invoke(), is that what I'm looking for?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Lumpierbritches |
last post by:
Thank you in advance. Is there a way to anchor a child form say beside the
parent form, when that data is needed?
Michael
|
by: Omar Llanos |
last post by:
I have Form1 and Form2 (which is inherited from Form1), and I created a
button in Form2 that will fill up a textbox in Form1. What code would do
that?
I tried the simplest way:
//from child...
|
by: Fred |
last post by:
Is there a good code sample, in C#, showing how to send
eamil with attachment, from a Windows Form like 'Send To'
in Word, that will pickup Contacts in Outlook/Exchange
2000.
I have searched...
|
by: mimi |
last post by:
Hi,
I've been searching all the posts and articles but couldn't find any example
on how to send attachments with pop3 using C#. Does anyone have one or know
how? Thanks
|
by: Paul |
last post by:
Hi this is related to a previous post, hopefully just a bit clearer
description o the problem. I have a parent form that opens a new form (child
form) while still leaving the parent form open....
|
by: LEE |
last post by:
I'd like to call a function of child from parent form,
there is an issue:
Form1 (parent) calls "LoadMe" Sub in Form2 (child), it
works using the codes (in Form1):
Dim frm As New Form3()...
|
by: John |
last post by:
Hi
I have posted this question several times but have received no reply. I have
a main form which contains a panel which in turn contains a child form, like
this; MainForm->MyPanel->ChildForm....
|
by: mabond |
last post by:
Firstly I hope I'm in the right forum ..... if not can someone re-direct me
please.
I have an application with a main form properties set to mdiparent = true.
Toolbar button allows user to open...
|
by: FNA access |
last post by:
I have read through many posts that are relevant to my topic and have not had any success.
I want to click a button on my form and send an email to a list of people I have stored in a table with...
|
by: svibuk |
last post by:
i have a div element with a child control in it which gets populated with data
depending on data teh control expands and also the div. if i set the div width the data overflows in the extended...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
|
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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |