what are the things i shoul import?.. and how could i display a message box in c#? sample code will help me a lot.....
How to display message box using c#
Collapse
X
-
-
hi...Originally posted by nirmalsinghwhat are the things i shoul import?.. and how could i display a message box in c#? sample code will help me a lot.....
u can have messageboxes displayed in C#...
for that u have to import System.Runtime. InteropServices
like
using System.Runtime. InteropServices ;
then within ur class, write
[DllImport("User 32.dll")]
public static extern int MessageBox(int h, string m, string c, int type);
now u can easily call the function MessageBox()... .
Hope this will help u..
thanks... -
If it is windows applications you can directly call the function MessageBox.Show ("hello");
The above function
if it is webapplication you have to use javascript fumction to get messageBox
I hope it is clear.Comment
-
I have tried this code but it's not working, reply plz....why?Originally posted by sandeepk84hi...
u can have messageboxes displayed in C#...
for that u have to import System.Runtime. InteropServices
like
using System.Runtime. InteropServices ;
then within ur class, write
[DllImport("User 32.dll")]
public static extern int MessageBox(int h, string m, string c, int type);
now u can easily call the function MessageBox()... .
Hope this will help u..
thanks...Comment
-
I wants to use skin file in c#. Wheather this fascility is available in the c# plz... reply.Originally posted by sandeepk84hi...
u can have messageboxes displayed in C#...
for that u have to import System.Runtime. InteropServices
like
using System.Runtime. InteropServices ;
then within ur class, write
[DllImport("User 32.dll")]
public static extern int MessageBox(int h, string m, string c, int type);
now u can easily call the function MessageBox()... .
Hope this will help u..
thanks...Comment
-
please check ur code once more...Originally posted by sunilkundekar5I have tried this code but it's not working, reply plz....why?
have u called d MessageBox function wid d rigt no. of parameters?
also remember to include
[DllImport("User 32.dll")]
public static extern int MessageBox(int h, String s, String s1, int type);
in d global variable declaration section( within class, out side member functions)
then u must get d function ready 2 b called...
u can call it by having arguements 'h' and 'type' as 0...
s is d msg to b displayed and s1 is the title...give some strings for those params...
hope dis will help u..
thanx and rgrds...
sand...Comment
-
Yeah...it's possible...u can have d skin files added in ur pjt...Originally posted by sunilkundekar5I wants to use skin file in c#. Wheather this fascility is available in the c# plz... reply.
u can put the skin files in d " App_Themes" folder...
thanx and rgrds..
sand...Comment
-
If you are using c# in asp.net then make javascript function in codebehind and register it with codebehind and call where u need it.Originally posted by nirmalsinghwhat are the things i shoul import?.. and how could i display a message box in c#? sample code will help me a lot.....
Example:-
private void MsgBox(string msg)
{
string showMsg = "<script language='javas cript'>" +
"alert("+msg+") ;</script>";
RegisterStartup Script("ds",msg );
string str = "<script language='javas cript'>" ;
str = str + "alert('" + msg + "' )" ;
str = str + "</script>";
RegisterStartup Script("ds",str );
}
Dhananjay SinghComment
Comment