Solved

UserControll-How to implement ival=MyUserControl (instead of  ival=MyUserControl.value)

Posted on 2006-06-20
10
261 Views
Last Modified: 2010-05-18
UserControll-How to implement ival=MyUserControl (instead of  ival=MyUserControl.value)

I have a user control.
I want to be able to do:
dim iVal
iVal =MyUserControl

Like i do in checkbox control.
iVal=ckbSomeCheckbox
and get the ckbbox value.

or in TextBox control
(sText=txtSomeTextBox)


 
0
Comment
Question by:allallall
  • 6
  • 3
10 Comments
 
LVL 1

Author Comment

by:allallall
ID: 16947052
It should be easy no?
0
 
LVL 3

Expert Comment

by:Dimkov
ID: 16948898
allallall,
I program in C++, and what I would do in your case is overwrite the = operator.

in c++ it will be
int operator=(const usercontrol MyUserControl)
{
   return MyUserControl.value;
}
Hope it helps, Dimkov
0
 
LVL 1

Author Comment

by:allallall
ID: 16951910
Hi.
As far as i know, there is no "operator overloading"  in vb6
0
 
LVL 3

Expert Comment

by:Dimkov
ID: 16957477
allallall

Operator overloading is a new in the VB world, but with VS2005 you can use it:

it should be like:

 Public Shared Operator =(ByVal MyUserControl As usercontrol ) As int
        Return MyUserControl.value

Dimkov
0
 
LVL 1

Author Comment

by:allallall
ID: 16958963
I am writing in vb6 not in vs2005.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 3

Expert Comment

by:Dimkov
ID: 16959159
in this case, you cant acheave this thing.
The reason is, the compiler doesnt know if you want the control to return integer, or string or boolean....
Sorry I couldn't be from more help
0
 
LVL 1

Author Comment

by:allallall
ID: 16964815
I think it can be done since you can do so with vb controls like TextBox or Checkbox.
 
0
 
LVL 1

Author Comment

by:allallall
ID: 16975037
Someone?
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 440 total points
ID: 17039809
0
 
LVL 1

Author Comment

by:allallall
ID: 17045832
Idle_Mind  Thanks.
Write a comment here:
http://www.experts-exchange.com/Programming/Q_21908096.html
too, so i will be able to give you the points from that question too.

Thanks.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Replace a tag with sed 2 43
wordcount challenge 11 78
move one pixel 4 42
Please explain: Aspect Oriented Programming 2 57
RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now