there is one little problem with your code but it can be fix:) MsgBox = new CustomMsGBoX(); MsgBox.label1.Text = Text; MsgBox.Text = Caption; MsgBox.button1.Text = btnok; MsgBox.button2.Text = btncancel; result = DialogResult.No; MsgBox.ShowDialog(); return result;
you have to reset the result every time or onces you click yes any time after that it will return result as yes
and i change the label with a text so if a string was add it would fit it all in because of wordwrap and set the textalign to center so the message was in the middle i can send it to if you would like that
@heidihas300 Man I just wanted to show how to create a simple custom message box! Now it's viewers job to fix it and improve it. You don't have to send it to me, I know what you're talking about. XD Thx anyway! :)
hey nice job done!
But can you explain cox i didn't understand why you call show() method with the class name
CustomMsgBox.show("This is a custom message box".........); not by its object like
MsgBox.show(............);??
i am new to C# help me..
XProdUcti0ns1 2 months ago
Is their a way to but a textbox in that custom messagebox
MrCSharpProgrammer 1 year ago
there is one little problem with your code but it can be fix:) MsgBox = new CustomMsGBoX(); MsgBox.label1.Text = Text; MsgBox.Text = Caption; MsgBox.button1.Text = btnok; MsgBox.button2.Text = btncancel; result = DialogResult.No; MsgBox.ShowDialog(); return result;
you have to reset the result every time or onces you click yes any time after that it will return result as yes
I hope help you out :)
heidihas300 1 year ago
@heidihas300 Thanks man! I forgot that XD
TheDarkJoker094 1 year ago
@TheDarkJoker094
np
and i change the label with a text so if a string was add it would fit it all in because of wordwrap and set the textalign to center so the message was in the middle i can send it to if you would like that
heidihas300 1 year ago
@heidihas300 Man I just wanted to show how to create a simple custom message box! Now it's viewers job to fix it and improve it. You don't have to send it to me, I know what you're talking about. XD Thx anyway! :)
TheDarkJoker094 1 year ago
nice, thanks alot
Gmicrosh 1 year ago