15,892,809 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 hemendrapadia (Top 10 by date)
hemendrapadia
29-Aug-20 1:59am
View
Sorry, forgot to thank you.
Thank you very much for your response.
hemendrapadia
28-Aug-20 12:26pm
View
But first one is working.
hemendrapadia
28-Aug-20 12:17pm
View
Yes i tried that recursive but it throws error.
My code is as below:
Sub ManageControlFocusColor(ByVal controls As ControlCollection)
For Each c As Control In controls
If c.HasChildren Then
ManageControlFocusColor(c.Controls) 'Throws error here
End If
If TypeOf c Is TextBox Then
If c Is ActiveControl Then
c.BackColor = Color.LightSteelBlue
Else
c.BackColor = Color.White
End If
End If
'
If TypeOf c Is Button Then
If c Is ActiveControl Then
c.BackColor = Color.LightSteelBlue
Else
c.BackColor = Button.DefaultBackColor
End If
End If
Next
End Sub
----------------------------
Error
----------------------------
System.InvalidCastException: '[A]ControlCollection cannot be cast to [B]ControlCollection. Type A originates from 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' in the context 'Default' at location 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll'. Type B originates from 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' in the context 'Default' at location 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll'.'
hemendrapadia
24-Jul-19 1:09am
View
All the DLLs related to Crystal report, I think like Hanumanji(don't know sanjivani, then take whole mountain) i don't know which dlls,so all dlls.
hemendrapadia
10-Jul-15 13:13pm
View
I will take this solution as last option, i m thinking other way without creating controls. i have done it in VB6.0 but forget the code, and lost my code in damaged harddisk. Anyway thank you very much for your support.
hemendrapadia
10-Jul-15 9:56am
View
Thanks Bojammis
But i have to do it with all control it is not only one textbox type control
i want any type of control that can have focus.
actually i must use the word -active control backcolor change on focus-
hemendrapadia
23-Jun-15 14:17pm
View
yes you are right. That is why i plan to change the code.
hemendrapadia
23-Jun-15 14:14pm
View
yes, i simply not want to write in each and every control's event.
I know about -enter- and -leave- event but it could be generalized.
Even i use theme window all display styles of controls decided there in that window(form)
hemendrapadia
23-Jun-15 13:38pm
View
Simple native vb.net controls. No customized control
hemendrapadia
23-Jun-15 13:34pm
View
no no customized control
Show More