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

Activex control

Hi

I'm just starting out in VB so please be patient.

I am creating an activex control, in the class there is a single variable
that is to be validated when set. Currently I am using the let/get property
to set and retrieve this value. Should I perform the validation within the
let property or within a function that then calls the let, I ask this as a
let does not seem to be able to return a value.

Thanks in advance.

Rich
Jul 17 '05 #1
3 1867
You can validate the value sent in the Let procedure
to make sure it's a valid setting. Is that what you mean?
If you want to return a result you need to use a function.

Private Name1 as string

Public Property Let Name(sName as string)
'-- you can validate whether this incoming value is a relevant string
'-- but you need a function to return a result. In this case, you'll
'-- assign incoming value to property only if first letter is "m".
'-- If they send "tree" the property will not be set but they won't
'-- know that unless you raise an error.

if (len(sName) > 0) then
If Ucase$(Left$(sName, 1)) = "M" then Name1 = sName
end if
End Property

Public Property Get Name() as String
Name = Name1
End Property

I'm just starting out in VB so please be patient.

I am creating an activex control, in the class there is a single variable
that is to be validated when set. Currently I am using the let/get property to set and retrieve this value. Should I perform the validation within the let property or within a function that then calls the let, I ask this as a
let does not seem to be able to return a value.

Thanks in advance.

Rich

Jul 17 '05 #2
You can validate the value sent in the Let procedure
to make sure it's a valid setting. Is that what you mean?
If you want to return a result you need to use a function.


Ok thanks I think I need to use a function then.

Rich
Jul 17 '05 #3
There's no problem with that. The only reason to use
a Property is because it's clean and easy from the other
side. They can just use:

s = Ob.Name
or
Ob.Name = s

But you could also use a Boolean function:

Public Function Name(sName as String) as Boolean

and they'd then call it with:

Bool1 = Ob.Name(s)
If Bool1 = True then '-- s was valid.
You can validate the value sent in the Let procedure
to make sure it's a valid setting. Is that what you mean?
If you want to return a result you need to use a function.


Ok thanks I think I need to use a function then.

Rich

Jul 17 '05 #4

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

Similar topics

1
by: wang xiaoyu | last post by:
Hello: i want use activex in wxpython program,but when i use MakeActiveXClass an exception occurs. this is my source code dealing the DICOM ocx.I must note that in this program "hwtxcontrol" is...
2
by: Fie Fie Niles | last post by:
This one XP machine (with IE 6) is having a problem viewing any ActiveX controls (created on VB6) on the Internet Explorer browser. I put the same ActiveX control in a VB program, and when I run...
1
by: Anand Kale | last post by:
How to have ActiveX control called from Web Form in ASP.Net ? ActiveX control is written using VC++/MFC/ATL-COM. Also kindly answer following issues, 1. Also how to take care of issues about...
3
by: Jeffery Franzen | last post by:
Anyone know where the documentation is regarding Activex controls in asp web forms? I'm using VS.NET 2002 enterprise and am trying to use Activex controls in vb.net web form app. I do the add...
3
by: Weston Fryatt | last post by:
Simple question I hope.... How do I send data to and from an ASP.Net (server side) web page to a ActiveX Control (client side) embedded in a web browser??? What I need to do, is I have image...
7
by: Jarod_24 | last post by:
I just downloaded a activex control that was written in C# and tried to view it on my PDA's Internet Explorer. At my regular PC it displayed just fine, but nothing showed up on the pda. Do...
1
by: Jayender | last post by:
Hi, I have an ActiveX control (to display the Images),I have added the reference of that in my web based applicaton .and added the ocx in my tool bar , but the viewer (activex component- ocx ) is...
6
by: Budhi Saputra Prasetya | last post by:
Hi All, I'm trying to display .NET Custom Control (created using Inherited Control) on an ASPX page, but no luck. I already registered the Control to Global Assembly Cache through .NET Framework...
6
by: hufaunder | last post by:
I have an ActiveX component that I want to use in a library that I am writing. As a first test I used the ActiveX component in a windows form application. Adding the component created: Ax.dll...
7
by: Artie | last post by:
Hi, Our team have a web project which includes some C# ActiveX DLLs. On some developers' PCs, the code which calls methods in the ActiveX dll is succesful - no exceptions. On other PCs, the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...

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.