---
title: "Get form name which form control are triggered in C#?"  
description: "Get form name which form control are triggered in C#?"  
author: "Anonymous User"  
published: 2013-03-06  
updated: 2013-03-06  
canonical: https://www.mindstick.com/forum/626/get-form-name-which-form-control-are-triggered-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Get form name which form control are triggered in C#?

Hi [Expert](https://www.mindstick.com/articles/13120/an-expert-financial-advice-will-improve-your-finances)!

I am creating a [log file](https://www.mindstick.com/articles/327201/create-log-file-in-c-sharp) for [stored](https://www.mindstick.com/forum/157561/what-is-the-stored-procedure-create-a-procedure-to-find-the-record-by-stu_id-from-the-student-table) generated [exception](https://www.mindstick.com/articles/1824/objective-c-exception-handling), so I have needed to get which [form](https://www.mindstick.com/forum/6/multi-form-mfc-application) [control](https://www.mindstick.com/blog/197/asp-dot-net-repeater-control) are fire. Please help me for getting [name](https://yourviews.mindstick.com/view/87450/how-to-generate-a-brand-name-using-linkedin-comprehensive-guide) of current [windows](https://www.mindstick.com/articles/311752/how-to-install-and-use-the-google-wifi-software-on-a-windows-or-mac-computer) form are open.

Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)!

## Replies

### Reply by AVADHESH PATEL

Hi Ben!

There are two way!

If you want to used as globle then try this way

string sFormName = this.FindForm().Name;

Another way is, if you get form name at same page then used this way, but above code are used both places

string SFormName = this.ActiveControl.FindForm().Name.ToString();


---

Original Source: https://www.mindstick.com/forum/626/get-form-name-which-form-control-are-triggered-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
