15,903,175 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 11700078 (Top 6 by date)
Member 11700078
3-Feb-21 13:49pm
View
ItemsCollection instance means New ItemsCollection and that is in my user control level. I mentioned earlier that my User Control is having a Property Called 'Items' As ItemsCollection. Codes are like this <designerserializationvisibility(designerserializationvisibility.content), category("data"),="" description("items="" in="" the="" combo="" box.")=""> _
<editor("system.windows.forms.design.stringcollectioneditor, system.design",="" "system.drawing.design.uitypeeditor,="" system.drawing")=""> _
Public ReadOnly Property Items() As ItemsCollection 'System.Collections.Specialized.StringCollection
Get
Return P1Value
End Get
End Property
Dim P1Value As New ItemsCollection. So I think ItemsCollection instance is in the user control level. if Items' Count property changes or items are cleared accordingly clear all the Labels Texts or if Items Count become 1 only first label will be texted. I think, it doesn't make any difference, collectionChanged or PropertyChanged as long as my user control gets the value of count property of Items property. A ComboBox is best example, during run time if I Execute Me.ComboBox1.Items.Clear(), it removes all the entries of the ComboBox. Same thing I want to do. Thanks and Regards.
Member 11700078
3-Feb-21 11:06am
View
Thanks a lot Mr. Richard Deeming,
As per your suggestion I remove the implementation of INotifyPropertyChnaged. I am still getting the Event. But with this my problem is not solved. I used this collection class in my User control's Items Property. I need, need to transfer this event in user control level so that the Labels' texts are update as per Items.Count.
Suggest me how do I get the Event in User Control level. Or if I implement INotifyPropertyChanged in User Control level, and any change in user control's 'Items property', will it trigger the event. Suggest what shall I do. Thanks. Regards.
Member 11700078
1-Feb-21 0:35am
View
Dear Gerry Schmitz, Thanks for the suggestion. I have not inherited CB, I wanted to create it from scratch. For learning purpose only. New, Please help me if you can.
My user control is having a property Items() as System.Collections.Specialized.StringCollection. This collection is having methods like Add(), Clear() etc. If I add a string the Count property increases by one, if I use Clear(), count become zero. How my control will come to know that count has changed. Can I add a new Event CountChanged() . Please help me in this. Regards.
Member 11700078
31-Jan-21 16:55pm
View
Thanks a lot Mr. Maciej Los for the guidance.
I have some more doubts.
I have added the user control on a form. In the design mode of the form, the user control is having the property 'Items' in the property grid. on clicking the eclipse the collection editor pops up, I added three lines. During run mode of the Form my user control shows the three lines (Items). I have added on Button on the form, behind the Button I wrote "MyControl.Items.Clear()". this should clear all the three items. but this is not happening. This will not happen because I have not written any code for this to happen. I don't know what to write and where to write. Similarly I tried to add new item, it is not adding. You have suggested "YourUserControlInstance.Items.Add("new Item")" when is mycontrol's instance, in the load event of the user control or at the Form level ? I am confused, please guide me.
Methods of String Collection Like 'Clear()', 'Add()' works automatically ? Please see that the Property is "Public ReadOnly Property Items() As System.Collections.Specialized.StringCollection"
Regards.
Member 11700078
18-Jan-21 10:30am
View
Thanks a lot this is working fine.
Member 11700078
10-Sep-20 8:26am
View
Dear Richard MacCutchan,
Actually it may be simple who knows about this. I did not clarify the case properly.
I have a Mdi Parent, on which a DataGridView, a MenuStrip with three buttons.
Clicking the one button loads a child form and displays. At the same time 15 Messages are written in the DGV. 77 Message is written when Parent form is displaced. When Child form loaded another 15 Messages written. i wanted to know, which message value is for Child Form Displayed. I understand that after display Child Form Active Message is also sent. Just see if any body can give any idea.
Regards.
K.K.Barman.
Show More