Let's say I have an add and edit button. both of these buttons bring up the same form and have the same save button inside the form. when I click on save after clicking the add button it inserts into the database and when I click on the save button after clicking the edit button it updates the records. would this be possible or do I have to create a new similar form for this?
Is it possible to change the function of a button when I click on another button?
487 views Asked by VinceG At
1
There are 1 answers
Related Questions in C#
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in .NET-2.0
- Existing Encryption and Validation method in Machine Key of IIS suddenly stops working
- Why are my input values not binding to my viewmodel?
- Why add-migration command is giving error although build succeeds in Visual Studio using .NET
- Legacy .NET CF download - Post-deploy error 0x00000001
- XmlSerializer much slower when a different constructor for it is used
- Part of DOM is deleted in ASP.NET 2.0 app on IIS 10
- What's the Microsoft DI equivalent of Castle.Windsor's DependsOn Dependency.OnValue
- C# NET. Framework 2.0 | Make a delay?
- TimeSpan.Parse of string including days dd-hh:mm:ss
- Webclient doesnt like UrlEncoded slash. How to make it work?
- unity c#, unable to acces a variable form another script
- How do I refresh my datagrid view from another form after I insert and update my values inside my database?
- Why can't I update my dates in database from 01/01/1753?
- Why is my datagrid not updating after I update my database?
- How do I compile a simple WinForms C# application for .NET Framework 2.0 in Visual Studio 2005 or 2019?
Related Questions in WINDOWS-FORMS-DESIGNER
- how check if printing content on new page
- How can I make background of a button transparent when it is on top of other colored buttons?
- error : Object refrence not set to an instance of an object
- Can't open WinForms forms anymore in Designer, VS2022, .NET 8
- Trouble creating in-editor button in custom control
- Restore mdi children after Controls.Clear
- Screen-sharing in C# Windows Form using TCP: half screen glitched out
- How do I parse values to text boxes from a row of selected cell in a datagridview in a windows forms app?
- Forbid to move cursor in RichTextBox past certain position
- Import files (.png...local files) as assets like Windows Forms importer does
- Visual Studio Form designer started displaying my form like it is zoomed in
- Why does Windows Forms Designer resize my controls?
- Why is the WinForms editor causing so much code change?
- How to add a user control (from a DLL file) to the .NET Core's Windows Forms designer controls toolbox?
- How to Open the Explorer on the Windows 11
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
You should have a class defining your form, with a set of fields and a Save button.
The save button on your form does not insert the data directly but instead, it calls an event with the data user typed.
Then your application creates an instance of this form, register an event handler et does what it wants (insert or update for instance)
A very quick example (pseudo-code):