Highlighted
Absent Member.
Absent Member.
461 views

Forms button not working in VC for VS 2015

Jump to solution

i apologize for posting this problem again but I am at a loss as to where to look for a solution. I have scoured the internet asking every question I could think of to get some pertinent information but have not had any luck . The only answer I found was to set the causes validation property to false, which I tried but it did not work.Is there any solution to this problem or is it just an unfixed bug? I would appreciate any feedback at all. Thanks - John

P.S. I have moved this button's logic to another click event and the logic works so it can't be getting lost there.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

I am not sure why you created a new post for this question as I and another had already posted a reply to your original post.

What product version are you using?
In earlier releases I had seen instances where the Forms Designer might overwrite the .Designer.cbl portion of the class and this could cause event handlers to be lost.

Event handlers are added to your controls in the .Designer.cbl file and would look something like:

*> button1

set button1::Location to new System.Drawing.Point(185 248)
set button1::Name to "button1"
set button1::Size to new System.Drawing.Size(75 23)
set button1::TabIndex to 0
set button1::Text to "button1"
set button1::UseVisualStyleBackColor to True
invoke button1::add_Click(new System.EventHandler(self::button1_Click))

If the highlighted line above is missing then this is why your event handler is not working properly.

I would recommend adding the event handler again by opening up the event handler window under Properties (lightning icon) and then typing in a new name for your handler under the Click event and pressing enter. It should create a new method in your code-behind file that will become the new event handler for the Click.

View solution in original post

1 Reply
Highlighted
Micro Focus Expert
Micro Focus Expert

I am not sure why you created a new post for this question as I and another had already posted a reply to your original post.

What product version are you using?
In earlier releases I had seen instances where the Forms Designer might overwrite the .Designer.cbl portion of the class and this could cause event handlers to be lost.

Event handlers are added to your controls in the .Designer.cbl file and would look something like:

*> button1

set button1::Location to new System.Drawing.Point(185 248)
set button1::Name to "button1"
set button1::Size to new System.Drawing.Size(75 23)
set button1::TabIndex to 0
set button1::Text to "button1"
set button1::UseVisualStyleBackColor to True
invoke button1::add_Click(new System.EventHandler(self::button1_Click))

If the highlighted line above is missing then this is why your event handler is not working properly.

I would recommend adding the event handler again by opening up the event handler window under Properties (lightning icon) and then typing in a new name for your handler under the Click event and pressing enter. It should create a new method in your code-behind file that will become the new event handler for the Click.

View solution in original post

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.