473,394 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to display message box using c#

nirmalsingh
218 100+
what are the things i shoul import?.. and how could i display a message box in c#? sample code will help me a lot.....
Dec 14 '06 #1
7 69770
what are the things i shoul import?.. and how could i display a message box in c#? sample code will help me a lot.....
hi...
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("User32.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...
Dec 14 '06 #2
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.
Dec 16 '06 #3
hi...
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("User32.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...
I have tried this code but it's not working, reply plz....why?
Jan 2 '07 #4
hi...
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("User32.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...
I wants to use skin file in c#. Wheather this fascility is available in the c# plz... reply.
Jan 2 '07 #5
I have tried this code but it's not working, reply plz....why?
please check ur code once more...
have u called d MessageBox function wid d rigt no. of parameters?
also remember to include

[DllImport("User32.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...
Jan 2 '07 #6
I wants to use skin file in c#. Wheather this fascility is available in the c# plz... reply.
Yeah...it's possible...u can have d skin files added in ur pjt...
u can put the skin files in d " App_Themes" folder...
thanx and rgrds..
sand...
Jan 6 '07 #7
what are the things i shoul import?.. and how could i display a message box in c#? sample code will help me a lot.....
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.
Example:-
private void MsgBox(string msg)
{
string showMsg = "<script language='javascript'>" +
"alert("+msg+");</script>";
RegisterStartupScript("ds",msg);
string str = "<script language='javascript'>" ;
str = str + "alert('" + msg + "' )" ;
str = str + "</script>";
RegisterStartupScript("ds",str);

}

Dhananjay Singh
Jan 6 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mamatha | last post by:
Hi I want to develop a small application in C#.net . I want to display video using webcam in C#.net application,how can i code this? I am very new to C#.net,please give me any related links or...
1
by: Duppypog | last post by:
I have an asp.net page using a repeater control to display a dataset. When the dataset returned is null (no records matched the criteria) I want to display a message to the effect "No matching...
13
by: Benjamin Smith | last post by:
I am controlling the display status of a table row using the following code. <TR id="CCRow" style="DISPLAY:none"> Instead of hard coding "none" above, I would like to change that value using a...
8
by: Taras_96 | last post by:
Hi everyone, We' ve come to the conclusion that we wish the user to be directed to an error page if javascript is disabled <enter comment about how a webpage shouldn't rely on javascript here :)...
2
by: anoop | last post by:
Hello, I want to display message from .aspx.vb code behind file. I want to display data from SQL DataReader in the Message. what should I do. Thank you
1
by: todashah | last post by:
Hi ! Guys, I have no idea about How to Display Message Box on Screen while using Asp.net with C# ? Help Me. Thanks in advance...
1
by: ikirschner | last post by:
I need to create a message using VBA in Outlook which contains a file reference. I would like to create a hyperlink on the file reference so that the reader can simply click the link. I am using...
10
by: Leo sajjad | last post by:
Dear All, I am looking for code to display message box in c sharp language and guide line if any other requirement regarding to display message i mean to say that any class or namespeacing is...
21
by: mukeshrasm | last post by:
Hi I am deleting records from database using checkbox. means only that record will be deleted from database which are selected in checkbox. and before deleting record I am displaying a message...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.