473,568 Members | 2,762 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to display message box using c#

nirmalsingh
218 New Member
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 69788
sandeepk84
97 New Member
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("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...
Dec 14 '06 #2
josephkind
2 New Member
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
sunilkundekar5
3 New Member
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("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...
I have tried this code but it's not working, reply plz....why?
Jan 2 '07 #4
sunilkundekar5
3 New Member
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("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...
I wants to use skin file in c#. Wheather this fascility is available in the c# plz... reply.
Jan 2 '07 #5
sandeepk84
97 New Member
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("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...
Jan 2 '07 #6
sandeepk84
97 New Member
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
DhananjayIndia
2 New Member
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='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 Singh
Jan 6 '07 #8

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

Similar topics

1
15458
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 source code Thanks in advance
1
4183
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 records found". I can't figure out how to do this. Any help is greatly appreciated, Lynnette
13
1953
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 hidden input control. How to do that? I am getting the error in the following case. <TR id="CCRow" style="DISPLAY:"
8
2837
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 :) >. I've read quite a few posts on how to do this, but none meet my need (the two main suggestions was set a jsEnabled variable in a <scriptsection...
2
2329
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
1986
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
3242
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 the Redemption Add-On.
10
32827
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 required. Thanks Sajjad Ali
21
11091
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 "Are you sure to delete the selected records" using javascript.and when user clicks OK, record is deleted. Here in message I want it should like "Are...
0
7693
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7916
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7660
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6275
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5498
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2101
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.