473,624 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

custom UserControl with Proprety named "ReadOnly" in VB.NET

I am creating a custom control (Inherits UserControl) and my control
containt a TextBox control. TextBox control has a Property called
"ReadOnly". I would like to expose this property outside my own control, but
it seems impossible because when I write:

Public Property ReadOnly() as Boolean
....

The compilter treats ReadOnly as a Modifier and does not allow this
contruct. Can I expose a property of my control under a different name (so I
would create a property "_ReadOnly" and expose it as "ReadOnly")

It is very important for me to have a property called "ReadOnly" in my
control (excatly like TextBox does) to have a coherent code.

Any clues?

Regards,
Marcin Floryan
Nov 20 '05 #1
2 2289
Hi

Public property [ReadOnly]() as boolean

Ke
--------------------

----- Marcin Floryan wrote: ----

I am creating a custom control (Inherits UserControl) and my contro
containt a TextBox control. TextBox control has a Property calle
"ReadOnly". I would like to expose this property outside my own control, bu
it seems impossible because when I write

Public Property ReadOnly() as Boolea
...

The compilter treats ReadOnly as a Modifier and does not allow thi
contruct. Can I expose a property of my control under a different name (so
would create a property "_ReadOnly" and expose it as "ReadOnly"

It is very important for me to have a property called "ReadOnly" in m
control (excatly like TextBox does) to have a coherent code

Any clues

Regards
Marcin Florya

Nov 20 '05 #2
Hi

Public property [ReadOnly]() as boolean

Ke
--------------------

----- Marcin Floryan wrote: ----

I am creating a custom control (Inherits UserControl) and my contro
containt a TextBox control. TextBox control has a Property calle
"ReadOnly". I would like to expose this property outside my own control, bu
it seems impossible because when I write

Public Property ReadOnly() as Boolea
...

The compilter treats ReadOnly as a Modifier and does not allow thi
contruct. Can I expose a property of my control under a different name (so
would create a property "_ReadOnly" and expose it as "ReadOnly"

It is very important for me to have a property called "ReadOnly" in m
control (excatly like TextBox does) to have a coherent code

Any clues

Regards
Marcin Florya

Nov 20 '05 #3

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

Similar topics

2
1499
by: G Dean Blake | last post by:
I have a textbox in an ItemTemplate of a grid I'm using to allow users to change a value. I've done it a hundred times. In this project I have it returns the original amount even though the user enters a revised value in the textbox. the code is identical to my many working examples. However, I notice that the xml dataset that the grid is binding from I am using has msdata:ReadOnly="true" generated in it. I can't see how or why that...
5
1581
by: woodpecker | last post by:
when I set the datagrid's readonly=true,I can't set it back to false value,why? Anybody can tell me the reason? Thanks your help. Woodpecker.
1
1225
by: woodpecker | last post by:
when I set readonly=true,I can't set it back to the value "false",why? Anybody can tell me the reason and fix the problem? Thanks advance. Woodpecker.
0
212
by: Marcin Floryan | last post by:
I am creating a custom control (Inherits UserControl) and my control containt a TextBox control. TextBox control has a Property called "ReadOnly". I would like to expose this property outside my own control, but it seems impossible because when I write: Public Property ReadOnly() as Boolean .... The compilter treats ReadOnly as a Modifier and does not allow this contruct. Can I expose a property of my control under a different name...
2
5228
by: Daren Hawes | last post by:
Hi I need to add an attribute to a Textbox to make it read only. To add a CSS I use DeptDate.Attributes("Class") = "textInput" That adds 'Class="textinput"', but the readonly is like..
4
2052
by: Dany P. Wu | last post by:
Hi everyone, I'm not entirely sure if this is the best way of going about it, but here's the scenario.......... I have two datagrid, each bound to a datatable which have checkbox columns. There are two buttons between the datagrids, "Add" and "Remove". They basically remove rows from one grid to the other, only those with the checkbox ticked.
5
1533
by: Alex | last post by:
Hello, Is it possible to have a class that has "readonly" properties for some classes and can be written by others? The reason I want this is that some of my classes need to expose their "status", but I need to be ensure that this is only updated by the class that "owns" them, and is not updateable by anything else. Also, I'd rather these classes pass their "status" by reference instead of by value, so any other object querying this...
3
1715
by: Dan | last post by:
Hi all! When I throw my custom Exception class the first time in my code, the compiler takes a lot of time for find the following catch EX: try Throw New MyCustomException("test")
5
4135
by: elainenguyen | last post by:
Hi, since assigned "acFormReadOnly", my code supposes to allow user to only "read the form", but when I test the code, I can type and click on any of the fields on the form. What I really want the code to do is not allow user to be able to click or type on any of the fields, on the form. Any idea? please help. Dim db As Database Dim rst As Recordset Dim stLinkCriteria As String Set db = CurrentDb Set rst =...
0
8238
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8680
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
8478
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
7164
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6111
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5565
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
4082
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1485
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.