473,382 Members | 1,647 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,382 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 69769
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?

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.