473,830 Members | 1,954 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to create user difned controls? in v.b 6.0

52 New Member
Hi everybody!

I would like to develope an application, in this a should abel to create user defined controls. i should have some properties. when ever i drag and drop that control it should apper on the form and should work. i can abel to write code behind that(when i clicked that contro, some thing should be done).

for ex: now i am developing a electrical circuit GUI in v.b 6.0.my user defined control is generator( asume it is like a picture in a circuit). i shold abel to drag and drop many generators in my GUI.

How can i do it. what controls are to be used. if u provide sample code, i would be grateful to u.
regards:
raghunadhs
May 28 '07 #1
4 6022
Killer42
8,435 Recognized Expert Expert
There are much better tutorials for this on the web than we could come up with in a short time here.

Hm... we had a reference to one of them here recently. Hold on, I'll have a look...
May 28 '07 #2
Killer42
8,435 Recognized Expert Expert
Here we go...

http://pages.cpsc.ucalgary.ca/~saul/...al5/index.html
May 28 '07 #3
raghunadhs
52 New Member
dear killer,
Thanks for u r reply.... your link has helped me alot.
now i am able to create user controls, set some properties. but still i have a problem.
my user control is an image. now i would like to assign a propery to my control called "mycolor". my objective is when ever user assigns this property with a different color, then my user control's color should be changed. how it is possible? my idea is instead of making color to my control, why don't i replace the image with another image which has the required color. if it is fine how to replace that. kindly help me if u know it.

Thanku
raghunadhs

Here we go...

http://pages.cpsc.ucalgary.ca/~saul/...al5/index.html
Jun 5 '07 #4
Killer42
8,435 Recognized Expert Expert
I've been playing with some usercontrols myself, lately. I wouldn't claim to be expert, but can probably help a little.

The way I understand it, you need to...
  • Create a private variable to hold the property value. For example...
    Private m_MyColor As Long (or possibly As OLE_COLOR)
  • Optionally, create a constant to hold a default value. For example...
    Private Const m_def_MyColor As Long = &H00FF00 ' (Green)
  • Add routines to retrieve and set the property...
    Public Property Get MyColor() As OLE_COLOR
    MyColor = m_MyColor
    End Property

    Public Property Let MyColor(ByVal New_Value As OLE_COLOR)
    m_MyColor = New_Value
    PropertyChanged "MyColor" ' Note that property needs to be saved.
    ' I guess this might be where you need to do whatever
    ' it is you do with your color. Perhaps set UserControl.Bac kColor.
    End Property
  • In the UserControl_Rea dProperties routine, add your one...
    m_MyColor = PropBag.ReadPro perty("MyColor" , m_def_MyColor)
  • In the UserControl_Wri teProperties routine, add your one...
    Call PropBag.WritePr operty("MyColor ", m_MyColor, m_def_MyColor)
Have a play with that, let us know how it goes. It may take some fiddling to get it right (I know it does for me.)
Jun 5 '07 #5

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

Similar topics

7
3569
by: Bil Muh | last post by:
Esteemede Developers, I would like to Thank All of You in advance for your sincere guidances. I am developing a software using Visual C++ .NET Standard Edition with Windows Form (.NET) template. Briefly -------------------------------------------------------------------------------------------- I need to create dynamically some controls on the forms, and display these
3
10812
by: Kiyomi | last post by:
Hello, I create a Table1 dynamically at run time, and at the same time, I would like to create LinkButton controls, also dynamically, and insert them into each line in my Table1. I would then like that, when clicking the LinkButton, the user can be navigated to another page, carrying a variable. I would like to use server.transfer method instead of QueryString as I don't want the carried variable to be visible for the user.
0
3650
by: Patrick | last post by:
I'm working on a contact management application, and need a hand with one aspect... Here's what I want to create: ------------------------------------ A form split into two parts. There is a datagrid on the left side that lists names and perhaps a couple of other key fields. The user can click on a record in the datagrid, which should automatically pull up details on that record in the various text boxes and other controls on the right...
2
2546
by: macca | last post by:
Hi, I am writing a GUI application. It will have a number of user defined controls( I plan to use/create a user defined control that will output alarm states that the user can also select and will open a dialog to give more detailed information) . The number of controls on the main GUI will vary from client site to client site. I would therefore like to populate the dialog with these controls dynamically.
6
2305
by: Frank Wilson | last post by:
Tom, It sounds to me like ASP, not ASP.NET is handling the request for WebForm1.aspx. This is most likely an IIS config issue that may have been caused by order of installation or reinstallation, or possibly even something that happened in IIS before .NET was installed. Here is a way to prove or disprove my theory:
2
1573
by: Crosta | last post by:
Hi everyone, As subject suggests I'm wondering how is it possible to do so in ASP.NET. The fact is that I'd like to "atomize" an entire series of custom user controls (.ascx and .ascx.vb) to redistribuite them to friends but without having to give away my source code. I'd like to have only one clear, solid dll. Is it possible? Maybe even a similiar way. Thanks to everyone for the attention.
3
6762
by: Brian | last post by:
Hi, All, I want to create a single user control (component) with multi-controls. for example, I want to use one button control and 2 listBox controls to build one single user control. so, user can directely use the user control instead of 3 controls. They can click button to move the selected item from one listbox to another. but how can I inherit these 3 controls? And also, once I create the single user control, I can not implement the...
1
4668
by: MaryamSh | last post by:
Hi, I am creating a Dynamic Search in my application. I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove) By pressing Add button ,another row will be created with the same control (I mean another dropdown and 2 button) and so on. and by pressing Remove button the selecetd row will be removed. I used viewstate to keep my value for postback, I want by changing selectedvalue of...
0
3507
by: MaryamSh | last post by:
Create Dynamic Dropdownlist Controls and related event -------------------------------------------------------------------------------- Hi, I am creating a Dynamic Search in my application. I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove) By pressing Add button ,another row will be created with the same control (I mean another dropdown and 2 button) and so on. and by...
0
9642
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
10774
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...
0
10491
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10206
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
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5780
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4411
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3076
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.