---
title: "Line Shape in Windows Form"  
description: "Line Shape in Windows Form"  
author: "Jaya J"  
published: 2015-03-31  
updated: 2015-03-31  
canonical: https://www.mindstick.com/forum/23066/line-shape-in-windows-form  
category: ".net"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# Line Shape in Windows Form

I have draw a line shape in [windows](https://www.mindstick.com/articles/311752/how-to-install-and-use-the-google-wifi-software-on-a-windows-or-mac-computer) [form](https://www.mindstick.com/forum/6/multi-form-mfc-application) using Toolbox.Now i want to Blink that line shape when [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) was clicked at runtime.Tell me [anyone](https://www.mindstick.com/articles/23207/how-to-find-the-best-fit-job-for-anyone) is it possible in windows form using c#..If Possible tell me how to write the code.

## Replies

### Reply by Sumit Kesarwani

Hi Jaya, You can use a timer for this. On tick event of timer set line shape visibility to true and false and you can stat the timer on the button click like this:\

```
namespace WindowsFormsApplication3{    public partial class Form1 : Form    {        Timer timer = new Timer();        public Form1()        {            InitializeComponent();        }        private void button1_Click(object sender, EventArgs e)        {            timer.Start();        }        private void Form1_Load(object sender, EventArgs e)        {                       timer.Interval = 1000;            timer.Enabled = true;            timer.Tick += new System.EventHandler(timer_Tick);        }        private void timer_Tick(object sender, EventArgs e)        {            if (lineShape.Visible)            {                lineShape.Visible = false;            }            else            {                lineShape.Visible = true;            }        }    }}
```


---

Original Source: https://www.mindstick.com/forum/23066/line-shape-in-windows-form

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
