| | |
Me.WindowState evaluates wrong
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2007
Posts: 28
Reputation:
Solved Threads: 0
I have an if sentence in my vb.net windows form
The evaluation, as you can se I have tried in different ways, evaluates to true even it should be false. The value is normal and it shows me while debugging or printed out in a msgbox. What I want it to do is having it to go into the if-condition when the value is minimized. My simplest surgestion was "IF (me.WindowState = System.Windows.Forms.FormWindowState.Minimized ) Then" but this does not work. What am I missing???
VB.NET Syntax (Toggle Plain Text)
'If StrComp(WindowState.ToString, FormWindowState.Minimized.ToString) = 0 Then If Me.WindowState <> System.Windows.Forms.FormWindowState.Normal Then '[Object].ReferenceEquals(WindowState, FormWindowState.Minimized) Then ' System.Windows.Forms.FormWindowState.Minimized Then ' FormWindowState.Minimized Then ...
The evaluation, as you can se I have tried in different ways, evaluates to true even it should be false. The value is normal and it shows me while debugging or printed out in a msgbox. What I want it to do is having it to go into the if-condition when the value is minimized. My simplest surgestion was "IF (me.WindowState = System.Windows.Forms.FormWindowState.Minimized ) Then" but this does not work. What am I missing???
•
•
Join Date: Nov 2007
Posts: 28
Reputation:
Solved Threads: 0
•
•
•
•
Shouldn't you be saying something like:
if mBool = true Thenas opposed to:
if mBool Then
But I found the problem/issue. The compiler debugs into the Then but does not do the actions. Two same if sentences and it will enter the last one (but not do anything in it, just steps through). A compiler-error of some kind while debugging..
Well, problem/issue solved.. Thanks for reading along..

Have a lovely evening
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: About VB.NET
- Next Thread: VB.NET which language
| Thread Tools | Search this Thread |
.net .net2008 2008 access advanced application array basic beginner browser button buttons center click client code combo convert cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic eclipse excel exists fade filter forms function generatetags gridview html images input internet listview map mobile module monitor msaccess net number objects open panel pdf picturebox picturebox2 port position print printing problem read regex remove right-to-left save search searchvb.net select serial settings shutdown socket sqldatbase sqlserver survey temperature textbox timer timespan transparency txttoxmlconverter user usercontol vb vb.net vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winforms winsock wpf wrapingcode xml year






