15,911,715 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 Vince McElwee (Top 2 by date)
Vince McElwee
29-Jul-21 20:01pm
View
I wish to thank you for your patience and
quick responses. You seem to be very knowledgeable
in helping me with this obstacle of mine.
It seems all my documentation research uses C# as
examples instead of VB .NET WPF. This makes it
difficult for me to translate it into the VB code.
Yes, the Form.ControlBox = False VB statement is written
on a single line of code in isolation. I have no idea what "Form"
needs to be replaced with and its value.
No, I did not replace the class name "Form" with a actual instance
variable name, or with "this". The documentation says the "this"
keyword refers to the current instance of the class. I experimented
with the following VB statements:
VB Code Test #1...
this.ControlBox = False
"this" is flagged the same as "form" by Visual Studio with...
BC30188: Declaration Expected.
VB Code Test #2..
Dim hwnd As IntPtr = New System.Windows.Interop.WindowInteropHelper(this).Handle
and "this" is flagged by Visual Studio with...
BC30451: 'this' as not declared. It may be inaccessible due to its
protection level.
If you can use your expertise on what I'm failing to do, it would be
appreciated.
Perhaps you can write some VB .NET WPF code to prove results
to remove the form Close (X) button.
During my research I found the following article (again it is using C#):
How to hide close button in WPF window?
https://stackoverflow.com/questions/743906/how-to-hide-close-button-in-wpf-window
I know your time must be valuable, I can only express my sincere Thanks.
Vince McElwee
28-Jul-21 21:55pm
View
The "Disable the Close box on a form" quickest solution using...
Form.ControlBox = False
however my Visual Studio Visual Basic WPF flagged "Form" with a
error message...
BC30188: Declaration Expected.
Can you explain and help to correct?
Thanks.