473,396 Members | 1,998 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.

How to know how control is placed on a form

Control may be added on a form by double-clicking
it on the toolbox, or selecting it and then drawing on
the form.

Is there a parameter, a variable, a message that let
me say how control has been painter - before the
oncreatecontrol method?

--
thanks
Andrea
Nov 20 '05 #1
8 1317
Hi,

The control has a parent changed event. Maybe that is what you are
looking for.

http://msdn.microsoft.com/library/de...angedtopic.asp
Ken
----------------------
"Andrea Moro" <mo**********@tiscali.it> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Control may be added on a form by double-clicking
it on the toolbox, or selecting it and then drawing on
the form.

Is there a parameter, a variable, a message that let
me say how control has been painter - before the
oncreatecontrol method?

--
thanks
Andrea

Nov 20 '05 #2
Ken

it isn't what I'm looking for. I see for this property before
post, but there is any returned parameter, or casting option
that let me know in which way control is placed (designed
or dragged/double clicked).

Andrea
Nov 20 '05 #3

"Andrea Moro" <mo**********@tiscali.it> wrote in message
news:Os**************@TK2MSFTNGP10.phx.gbl...
it isn't what I'm looking for. I see for this property before
post, but there is any returned parameter, or casting option
that let me know in which way control is placed (designed
or dragged/double clicked).


I'm curious: why do you need to know?
Nov 20 '05 #4
> I'm curious: why do you need to know?

Well Jeff,

maybe that I'm missing something that may be solved
in another way, but actually I don't think to anything
else.

I would like to setup a defaultsize to the control when
it's posizioned by dragging or by double cliccking on the
toolbox.

I hoped that defaultsize property might be usefull, but
it's is readonly and not overridable. So I cannot set a minimu
control size and value proposed by framework is too much wide.

Isn't there any other way to set up it?

Andrea
Nov 20 '05 #5
"Andrea Moro" <mo**********@tiscali.it> wrote in message
news:Og*************@TK2MSFTNGP12.phx.gbl...
I would like to setup a defaultsize to the control when
it's posizioned by dragging or by double cliccking on the
toolbox.


One way is to use your own designer, which inherits from the control's
original designer. In it, you would place something like this:

Public Overloads Overrides Sub OnSetComponentDefaults()
MyBase.OnSetComponentDefaults()
MyBase.Control.Size = New Size(496, 312) ' whatever your desired
default size is
End Sub

Best Regards,

Andy
Nov 20 '05 #6
Andy thanks.
I don't tried it, but it sounds like what I'm looking for.
I searched for it a lot of time, but one of the main problem
of the ide - IMHO - is that doesn't show all possible
overloadable subs/functions.
This mean a lot of wasted time to search possibile routine
that can help us.

I think that MS - in the next version of Ide - should add
all overiddable routine inherited from all classes from
within a class depends.

Andrea
Nov 20 '05 #7
Andy

I'm not able to overloads the OnSetComponentDefaults.
Framework is saying that those method isn't a part of the
base class.

I'm inheriting from usercontrol.

I taked a look to the object browser, and serching for it,
it doesn't display anything. If I setup a reference for system.design
assembly for the working project, I can see it, but always I
don't know how to use it.

Can you help me again?

I'm doing a lot of confuision with assembly, namespaces etc.

Andrea
System.ComponentModel.Design > ComponentDesigner Class
seems doesn't exist on my pc.
Public Overloads Overrides Sub OnSetComponentDefaults()
MyBase.OnSetComponentDefaults()
MyBase.Control.Size = New Size(496, 312) ' whatever your
desired default size is
End Sub

Best Regards,

Andy


--
Grazie
Andrea
Nov 20 '05 #8
"Andrea Moro" <mo**********@tiscali.it> wrote in message
news:eS***************@TK2MSFTNGP09.phx.gbl...
I'm not able to overloads the OnSetComponentDefaults.
Framework is saying that those method isn't a part of the
base class.

I'm inheriting from usercontrol.


Your control will need to use its own designer, and that designer class is
where OnSetComponentDefaults goes. Check out
System.ComponentModel.DesignerAttribute in the help.

Best Regards,

Andy


Nov 20 '05 #9

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

Similar topics

2
by: Scott | last post by:
Perhaps someone in this group smarter than me can help me with this problem. On a data entry form, I have placed a command button to "close" the form when the user is finished entering the required...
14
by: simonmarkjones | last post by:
Hi, I'm having a bit of trouble editing an old database that was created quite a while ago by someone else. There is a form that lets the user select a member of staff and show details about the...
5
by: Patrick De Ridder | last post by:
If I create a new and separate User Control, in the same way as I would create a new Form with the IDE, and call it from the main form, like so: UserControl1 usc = new UserControl1();...
0
by: Shailaja Kulkarni | last post by:
Hi All, I am new to component development. I want to create custom control to arrange contained controls in form of polygonal shape. The objects are placed in separate panel on the some form....
3
by: Scott Schade | last post by:
I have a form onto which I add a control during execution. The control is a control that I wrote. The control has a number of controls on it. I would like to click on a button on the control and...
1
by: José Joye | last post by:
Hello, I'm playing around with dynamically loading user controls ...and having problems I created a really simple userControl (in fact contains a plain text box) and placed it into the...
2
by: ~~~ .NET Ed ~~~ | last post by:
I have a problem (don't we all?). I have a web form with multiple modules, some of these modules have an ASP.NET (server run) button. OK, now I have UserControlX which has one such button (say...
8
by: Arpan | last post by:
Consider the following code snippet (my main intention is to display the current time in a Label control as & when this ASPX page is accessed/refreshed): <script runat="server"> Class Clock...
0
by: davidr | last post by:
Hi, I have a panel that I load user Control in no problem. The problem arrises when I do a post back on one of these user controls. I have button it does a click event. In this click event I...
1
by: rjvrnjn | last post by:
I am developing a web user control and have a property exposed of type object. What I want is that when this user control is placed on a web form this property will pick up all the textboxes and give...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
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.