Click here to Skip to main content
15,900,907 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I tried this code when check box checked true then it runs otherwise not, but it is working normally not apply conditions here:

What I have tried:

VB
Protected Overrides Sub OnLoad(ByVal e As EventArgs)   'by this code just Form  form 
    Visible = False
    ShowInTaskbar = False
    Opacity = 0
    MyBase.OnLoad(e)
End Sub
Posted
Updated 23-Dec-18 2:35am
v2

It is not very clear what you want, but I think you need to use the CheckBox.CheckedChanged Event:
CheckBox.CheckedChanged Event (System.Windows.Forms) | Microsoft Docs[^]

Also see examples here: Visual Basic 2017 Lesson 21: Working with Checkboxes - Visual Basic[^]
 
Share this answer
 
v2
Comments
irfanansari 23-Dec-18 12:31pm    
sir sorry i think so i can not explain in good way actually my work has been done and thanks a lot your reply i just making a app of alarm there is textbox button and visual basic my.setting .date and retrieve data from setting you can understand sir i use a alarm just first form will load and user give a date selected a date then today.date will check that given date and then as date will match as user give last time then auto screen show otherwise form1 always will be start but not shows user it works backwork with windows startup and i just juse visible=false a
KarstenK 24-Dec-18 4:24am    
Take some time to learn from some tutorials. You are missing some basic knowledge. So your code writing is driving a car but having no knowledge about the traffic signs. Believe an seasoned coder: Investing this time helps you to achieve your goals faster and better. ;-)
Do yourself a favour: you have asked over 100 questions here now - including I suspect this very one earlier today - but you seem to have no idea how to ask a question in a form that can be answered.

The code you show doesn't have a checkbox, and can't involve one - it's the Load event for a Form which occurs well before the form can be displayed, and so well and truly before the user can access any GUI components like a checkbox. So if the user can't access the checkbox, why are you even thinking of checking to see what he selected?

And frankly, it looks like a (very poor) attempt to hide an app so the user doesn't know its running; which looks like malicious code - but you wouldn't write that, would you?

Think about your enormous pile of previous questions, and the ones that got good answers quickly. Why did they work, and the "type as little as possible" ones not? Ask ing a good question is a skill, and one you do not seem to be developing: instead you seem to be becoming a Help Vampire ...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900