You did not specify the UI library you need to use. You always need to do that.
However, in this case there is a general answer: buttons do not need any code. The code you need will go elsewhere and has nothing to do with the button triggering it.
I think by now you understand that nobody will give you any useful code. Nobody can code who-knows-what who-knows-why. It's almost apparent to me that even you don't clearly understand what you want, forget about others. Perhaps
don't even use "Improve question". First work until you come to understanding of what are you doing.
[EDIT]
Oh, I can see a pattern… You routinely ask about the "code for a button" even after I explained it makes no sense:
code for save button[
^].
Also, you never explain what do you want to achieve and why (the ultimate purpose). You always need to explain those things.
Please, either overcome this pattern, of stop asking your questions
of this sort at all and work at yourself. Your questions will not help you until you overcome this. Don't waste our time and your own time.
—SA