473,385 Members | 1,927 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,385 software developers and data experts.

Custom Components and Design time visibility

Hello:

I want to know if it's possible to have a component what
visibility at design time depends on how it's being created,
for example, if the component is manually dropped by the
user to a windows forms it should be displayed but if it's
automatically generated by a Designer, to be assigned to a
property of a different component, it shouldn't.

There are any way of achive this ??

Thanks in advance !!

--
Best regards

Carlos Guzmán Álvarez
Vigo-Spain
Nov 16 '05 #1
5 2807
You want a component (thats a reusable thing with no UI) to be visible at design time *on the form*? It should be visible in the component tray but not on the form by default. One of the big steps forwards I think that Winforms made was to differentiate between components and controls (controls are reusable tings with UI) so we didn't get the ridiculas thing like the timer control in VB6 where it takes up part of the UI design surface at deisgn time but has no runtime rendering.

Or have I misunderstood what you want?

Regards

Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog

Hello:

I want to know if it's possible to have a component what
visibility at design time depends on how it's being created,
for example, if the component is manually dropped by the
user to a windows forms it should be displayed but if it's
automatically generated by a Designer, to be assigned to a
property of a different component, it shouldn't.

There are any way of achive this ??
Nov 16 '05 #2
Hello:
You want a component (thats a reusable thing with no UI) to be visible at design time *on the form*? It should be visible in the component tray but not on the form by default. One of the big steps forwards I think that Winforms made was to differentiate between components and controls (controls are reusable tings with UI) so we didn't get the ridiculas thing like the timer control in VB6 where it takes up part of the UI design surface at deisgn time but has no runtime rendering.

Or have I misunderstood what you want?


Huummm i need to do something similar to the
System.Data.SqlClient.SqlCommand component,
if you drop a SqlCommand you see at design time
it but if you drop a SqlDataAdapter on a form the
SqlCommand components assigned to the SqlDataAdapter
aren't visible at design time.

--
Best regards

Carlos Guzmán Álvarez
Vigo-Spain
Nov 16 '05 #3
Carlos,

All you have to do in this case is derive from Component (or
MarshalByValueComponent) and then use that. The reason that the SqlCommands
don't show up is because the adapter will have the reference, so they don't
need to be stored on the class level, they just need to be assigned to
(which is what the designer takes care of).

Hope this helps.
"Carlos Guzmán Álvarez" <ca******@telefonica.net> wrote in message
news:eG*************@TK2MSFTNGP14.phx.gbl...
Hello:
You want a component (thats a reusable thing with no UI) to be visible at
design time *on the form*? It should be visible in the component tray but
not on the form by default. One of the big steps forwards I think that
Winforms made was to differentiate between components and controls
(controls are reusable tings with UI) so we didn't get the ridiculas
thing like the timer control in VB6 where it takes up part of the UI
design surface at deisgn time but has no runtime rendering.

Or have I misunderstood what you want?


Huummm i need to do something similar to the
System.Data.SqlClient.SqlCommand component,
if you drop a SqlCommand you see at design time
it but if you drop a SqlDataAdapter on a form the
SqlCommand components assigned to the SqlDataAdapter
aren't visible at design time.

--
Best regards

Carlos Guzmán Álvarez
Vigo-Spain

Nov 16 '05 #4
Hello:
All you have to do in this case is derive from Component (or
MarshalByValueComponent) and then use that. The reason that the SqlCommands
don't show up is because the adapter will have the reference, so they don't
need to be stored on the class level, they just need to be assigned to
(which is what the designer takes care of).


Thanks for the answer.

Not sure about this, i'm going to try to explait what i want to
do a little better :)

Ok, i'm the author of the Firebird ADO.NET provider and i'm trying to
add Design Time support to the data adapter implementation, i have a
Designer for the Data Adapter classclass, in one method of the Designer
i want to initialize the SelectCommand, InsertCommand, UpdateCommand and
DeleteCommand properties of the data adapter, i'm doing something
like this (in the method handler of one of the designer verbs supported
by the designer):

IDesignerHost host =
(IDesignerHost)this.Component.Site.GetService(type of(IDesignerHost));

DesignerTransaction transaction =
host.CreateTransaction("GenerateTypeDataSet");

if (((FbDataAdapter)this.Component).SelectCommand == null)
{ ((FbDataAdapter)this.Component).SelectCommand =
host.CreateComponent(typeof(FbCommand)) as FbCommand;
}

transaction.Commit();

Ok with this when i drop a FbDataAdapter into a form the FbCommand
component and i run the designer option that initializes the adapter the
Component assigned to the SelectCommand property is visible at design
time and and i want to hide it.

( The SqlCommand has a DesignTimeVisible property but i'm not sure
what is what it does .... and i f that can be what i need to implement
and how :) )


--
Best regards

Carlos Guzmán Álvarez
Vigo-Spain
Nov 16 '05 #5
Hello:
Not sure about this, i'm going to try to explait what i want to
do a little better :)


I think i have fixed it yet :)


--
Best regards

Carlos Guzmán Álvarez
Vigo-Spain
Nov 16 '05 #6

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

Similar topics

2
by: SammyBar | last post by:
Hi, I'm trying to bind a custom collection class to a data grid, following the guidelines from the article http://msdn.microsoft.com/msdnmag/issues/05/08/CollectionsandDataBinding/default.aspx....
5
by: Guy | last post by:
Guys Hope someone can help me! I'm having real problems getting properties I type against a control I have written at design time I have written a control by inheriting from the Button control....
7
by: Martin Schulze | last post by:
Hello, i tried to compose myself a custom usercontrol which is derieved from System.Windows.Forms.UserControl. It contains 2 comboboxes and one textbox (which are also custom controls, but...
2
by: glenn | last post by:
I have been looking to no avail for a book, site or something that explains the processes involved with writing my own custom components such as grids, textboxes and such and then registering with...
19
by: Dales | last post by:
I have a custom control that builds what we refer to as "Formlets" around some content in a page. These are basically content "wrapper" sections that are tables that have a colored header and...
8
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This Custom validator is used for comparing a value enterd by the user against the primary key in the SQL database. IF the...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
2
by: AMDRIT | last post by:
Hello everyone, I have created a custom component and one of its properties is a class object with it's own properties. During runtime, I can assign values to the class object properties just...
4
by: Colin Desmond | last post by:
Is it possible to write an attribute that changes the visibility of a class (public/private) etc based on some pre-compiler define symbol? We're writing some classes which will be called by an...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
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...

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.