Skip to main content


Showing posts with the label C#

PowerShell switch case call function

Code below collect user input and uses switch case statement to check if the input matches, and if it matches a function is called that will execute commands.Here’s the code:#get or read from user input$computer_name=read-host ("Enter Computer Name:")switch ($computer_name ){#if the input is computer_1 then function func_comuputer1 is called computer_1{func_computer1}computer_2{func_computer2}}#function called if computer_1 is the inputfunctionfunc_computer1 {write-host"You entered Computer_1"#or replaced with other function like reboot / shutdown /or other commands#Restart-Computer -ComputerName computer_1}
#function called if computer_2 is the inputfunctionfunc_computer2 {write-host"You entered Computer_2"#or replaced with other function like reboot / shutdown /or other commands#Ex: Enter-Pssession computer_2}

Code below will keep asking for input and will only exit if a specific string matches to exit the script. Here’s the code:do {$computer_name

Disable Maximize and Minimize control in a form using Visual Studio

How to disable minimizing and maximizing a form in C# or
How to create a border less form in Visual Studio?
Images below shows how to disable maximize and minimize control in a form.
Image below shows how to deactivate maximize option in a form:

Image of a form that does not allow maximizing:

Image below shows how to create a border less form, creating a border less form should provide an option within the form how to close the application.

Image of a border less form:

Till next time.. Have fun creating apps in Visual Studio...

================================ Free Android Apps:
Click  links below to find out more:
Excel Keyboard guide:

Heaven's Dew Fall  Prayer app for Android :
Catholic Rosary Guide  for Android:…