473,790 Members | 2,481 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to know when a component is draged on a form?

Hi all,
I'm trying to build a component which takes advantage of other components.
So, when this new component is draged to the form, I would like to insert
other components on the designer and relate them. But only the first time
the component is inserted! to avoid inserting components each time de form
is loaded in the IDE.
How can I hook the very first time a component is draged on a windows form?

Thanks for attention,
Mario Vazquez
Jan 17 '07 #1
4 1652
Hi,

I was also interested in that problem and I found that the ComponentAdded
event does not provide that info. There are several cases:

- A component added from the toolbox
- A paste operation
- An undo operation (that places a control that was deleted)
- ...

Maybe a control designer has other hooks but the ComponentAdded event that
add-ins can use doesn't.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
"Mario Vázquez" <al*****@micros oft.comescribió en el mensaje
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
Hi all,
I'm trying to build a component which takes advantage of other components.
So, when this new component is draged to the form, I would like to insert
other components on the designer and relate them. But only the first time
the component is inserted! to avoid inserting components each time de form
is loaded in the IDE.
How can I hook the very first time a component is draged on a windows
form?

Thanks for attention,
Mario Vazquez


Jan 18 '07 #2
Hi Carlos,

Thanks for the tip.
Well, it seems not an easy issue.
I've just found an interface (framework 2.0) that may help.
IComponentIniti alizer
It has two methods which give a choice to hook the creation of new and
existing components. But i've not investigate if this is true for all the
cases you expose.

Regards,
Mario Vazquez

"Carlos J. Quintero [VB MVP]" <no****@nospam. comescribió en el mensaje
news:eJ******** ******@TK2MSFTN GP06.phx.gbl...
Hi,

I was also interested in that problem and I found that the ComponentAdded
event does not provide that info. There are several cases:

- A component added from the toolbox
- A paste operation
- An undo operation (that places a control that was deleted)
- ...

Maybe a control designer has other hooks but the ComponentAdded event that
add-ins can use doesn't.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
"Mario Vázquez" <al*****@micros oft.comescribió en el mensaje
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>Hi all,
I'm trying to build a component which takes advantage of other
components. So, when this new component is draged to the form, I would
like to insert other components on the designer and relate them. But only
the first time the component is inserted! to avoid inserting components
each time de form is loaded in the IDE.
How can I hook the very first time a component is draged on a windows
form?

Thanks for attention,
Mario Vazquez



Jan 18 '07 #3
Ah, yes, I found that interface sometime ago but I don't know how to use it
from outside a control designer (from an add-in, for example). Let me know
if you get more info.
--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
"Mario Vázquez" <al*****@micros oft.comescribió en el mensaje
news:ep******** ******@TK2MSFTN GP04.phx.gbl...
Hi Carlos,

Thanks for the tip.
Well, it seems not an easy issue.
I've just found an interface (framework 2.0) that may help.
IComponentIniti alizer
It has two methods which give a choice to hook the creation of new and
existing components. But i've not investigate if this is true for all the
cases you expose.

Regards,
Mario Vazquez
Jan 22 '07 #4
Hi Carlos,

I still have'nt work with add-ins and macros, so I cannot properly talk
about it, but I'll explain you how I use this interface through the designer
of a component, and perhaps it helps you.
Anyway, I was testing the points you expose in your previous message, and
this interface does'nt solve them.

// Make the designer implements IComponentIniti alizer
class MyComponentDesi gner:System.Com ponentModel.Des ign.ComponentDe signer,
IComponentIniti alizer
{
...

// Implement the interface
void
IComponentIniti alizer.Initiali zeExistingCompo nent(System.Col lections.IDicti onary
defaultValues)
{
base.Initialize ExistingCompone nt(defaultValue s);
// hook point
}

void
IComponentIniti alizer.Initiali zeNewComponent( System.Collecti ons.IDictionary
defaultValues)
{
base.Initialize NewComponent(de faultValues);
// hook point }
}
}

"Carlos J. Quintero [VB MVP]" <no****@nospam. comescribió en el mensaje
news:ee******** ******@TK2MSFTN GP06.phx.gbl...
Ah, yes, I found that interface sometime ago but I don't know how to use
it from outside a control designer (from an add-in, for example). Let me
know if you get more info.
--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
"Mario Vázquez" <al*****@micros oft.comescribió en el mensaje
news:ep******** ******@TK2MSFTN GP04.phx.gbl...
>Hi Carlos,

Thanks for the tip.
Well, it seems not an easy issue.
I've just found an interface (framework 2.0) that may help.
IComponentInit ializer
It has two methods which give a choice to hook the creation of new and
existing components. But i've not investigate if this is true for all the
cases you expose.

Regards,
Mario Vazquez

Jan 23 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1504
by: Adam Knight | last post by:
Hello, I am currently using an evaluation version the (latest) sa file up component. I have noticed and am concerned with the fact that the file up form collection, seems to support only one reading of values. Once i have created an instance of the file up component upload a file and destroy it i am unable to gain access to posted values again.
3
29123
by: Steven K | last post by:
Hello, I am using an asp page (upload.asp) to gather information and to upload files to the web server using SoftArtisans SAUpload Tool. In the first page (upload.asp), I have a form for gathering info with the following: <form method="POST" action="upload_ok.asp" name="frmUpload" enctype="multipart/form-data"> <input type="hidden" name="cmdSearch" value="SearchValue"> <input type="hidden" name="cmdName" value="NameValue">
5
2358
by: Patrick Vanden Driessche | last post by:
Hi All, I'm currently writing an in-house Form validation framework (WinForms) which is based on 'Component'-inheriting object. So basically, I have a small hierarchy. FormValidator +-- ControlValidator +--ValidationRule
4
1288
by: JackRazz | last post by:
Is there a way to get a components parent form from within the component? Thanks - JackRazz
21
5232
by: StriderBob | last post by:
Situation : FormX is mdi child form containing 2 ListViews ListView1 contains a list of table names and 4 sub items with data about each table. ListView2 contains a list of the columns on each table and 11 sub items with data about each column. When a Row in ListView1 is selected the Data in ListVies2 is loaded to show the correct data. Initially the first row in ListView1 is selected in FormX load
0
922
by: Mohammad Hashemian | last post by:
Hello, I'm writing an application and in one of my form, I used a COM component to design a special UI. this component added to the reference section of project, but when I close the IDE and open it again, in design part of my form an error displays with this message: One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code...
122
7437
by: Edward Diener No Spam | last post by:
The definition of a component model I use below is a class which allows properties, methods, and events in a structured way which can be recognized, usually through some form of introspection outside of that class. This structured way allows visual tools to host components, and allows programmers to build applications and libraries visually in a RAD environment. The Java language has JavaBeans as its component model which allows Java...
7
2230
by: Joe | last post by:
Is it possible to have a component which is global to the entire application? I need to have a single component act sort of like a server which components in any of the forms can access. For example if I drop a component on Form1 & Form2 and that component has a property called Server, at design time I would like to be able to assign the global component to the Server property. I'm sure I'm asking for way too much...
1
3028
by: Jiwei06xie | last post by:
Hi, I have a main form with 3 subforms and some combo boxes. It is working fine as an independent form. However, when I draged into a tabcontrol page, two off the combo boxes stopped working properly. The filtering criteria I used stopped functioning. Here are some details about my problem: (1) the following 1 main form and 3 off subforms are all in one-to-many relationships. Main form: mfrmCustomer Subform1: sfrmSite Subform2:...
0
9512
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10413
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10145
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9986
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9021
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7530
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3707
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.