473,748 Members | 2,625 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to display message in c sharp

4 New Member
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
Feb 27 '09 #1
10 32851
cloud255
427 Recognized Expert Contributor
Hi

Well I suppose we have these kinds of questions at some stage, the code is pretty self-explanatory so I will give it to you and you can read up about it using Intillisense.

Expand|Select|Wrap|Line Numbers
  1. System.Windows.Forms.MessageBox.Show("Text goes here");
  2.  
or to make things easier just type mbox and press <TAB> twice

This method has a huge amount of overloads and you can customize it a lot, so just play around with it.
Feb 27 '09 #2
PRR
750 Recognized Expert Contributor
In case of windows application you can make use of Message Box
and in case of asp.net use javascript . Also you can google for ajax message box
Feb 27 '09 #3
Leo sajjad
4 New Member
I code like this given bellow for message but their is a error

missing assemble or like some and the highlighlited windows word that what should i do

global::System.Windows.Forms.MessageB ox.Show("Hello world");

Thanks
Feb 27 '09 #4
PRR
750 Recognized Expert Contributor
Add reference to System.Windows. Forms in your ( i am assuming here a console application) application ... If its a web project ... use javascript... as server side code cant execute on client side ...
Feb 27 '09 #5
Leo sajjad
4 New Member
Hi,

I am trying to compare data if user select date for birth date field then it will compare today's data and subtract it by 18 year if it is valid then process further other wise send Alert Message that you are not eligible.

For this all what i have to do i am also searching it.

Please do replay.

Thanks
Apr 2 '09 #7
cloud255
427 Recognized Expert Contributor
Your question doesn't seem to have anything to do with this thread. Please start a new relevant thread.

As for calculating if the age is over 18 you could try:

Expand|Select|Wrap|Line Numbers
  1. DateTime MinimumBirthDate, SuppliedBirthDate;
  2. TimeSpan LegalAge = new TimeSpan();
  3.  
  4. LegalAge = TimeSpan.FromDays(365*18); //to get 18 years
  5.  
  6. MinimumBirthDate = DateTime.Now.Subtract(LegalAge);
  7.  
  8. SuppliedBirthDate = new DateTime(1203, 8, 8); //Enter birthdate supplied by the user here
  9.  
  10. if (MinimumBirthDate > SuppliedBirthDate)
  11. {
  12.       //over 18 code
  13. }
  14. else
  15. {
  16.      //under 18 code
  17. }
Hope this helps
Apr 2 '09 #8
xenoix
15 New Member
I probably wouldn't have spoon fed him the answer, but point him on the right direction.

IE: what methods/procs to use etc
Apr 2 '09 #9
Jeganath
8 New Member
Hi Sajjad Ali,

If u did not find out the answer till now, try this...

using System.Windows. Forms
MessageBox.Show ("Test Message");
Apr 2 '09 #10

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

Similar topics

0
445
by: Vi | last post by:
Some of you might be interested in this open source AutoUpdater for ..NET "Sharp AutoUpdater provides an auto-update feature for .NET applications. Using XML configuration files, Sharp AutoUpdater component detects if there is a new version of the software, downloads, unzips, and installs the new files." Link: http://csautoupdater.sourceforge.net/
0
1525
by: application | last post by:
is it possible to create a simple com dll in c-sharp? i need to use a c-sharp com from an asp page( not aspx) and i read in google about regasm and csc and some other strage words but never find a full example of how to do it. Thanks
2
1994
by: Ben | last post by:
Hi all I am new to C Sharp. Any suggestion for some good C Sharp sites? Thanks for sharing. Ben
0
1648
by: Eugene | last post by:
9rays.net Report Sharp-Shooter 1.3 has been published! Report Sharp-Shooter is the most flexible .NET report engine available on the market. It's a suite of 100% managed .NET components that allow you to create both bound and unbound reports with unlimited number of master-detail relations. You can build highly complex reports by using groups, columns, crosses, double pass mode, C#/VB scripting etc. Full data-binding model is supported...
4
2512
by: Hai Nguyen | last post by:
I'm learning C sharp and do not like vb much. I'm creatiing a wepage using panel to test myself. I tried to use these code below, which is written in VB, and to transform them to c sharp but I got hard time to understand vb syntax. I don't know if anyone in here can point out which is the equivalent object used in c sharp. Translate these two lines to C sharp: Sub Next_Click(Sender As Object, e As EventArgs) Select Case...
9
2355
by: Dragon | last post by:
Hi, I have 'some' experience in VB. I would like to learn C-Sharp and would like to know if the following book is any good or not. Thank you. Microsoft Visual C# .NET Step by Step - Version 2003 by John Sharp and Jon Jagger ISBN:0735619093
5
1183
by: Gill | last post by:
Hi There, Does anyone can give me advices to choose a graphical library/control/ocx/other to developp an application displaying 2d lines from large data set (around 30 000 points). I have to developp this app using Visual C++(6 or .NET). These data are coming right from an electronic device, and I need to display and print result as graphs in a short amount of time (less than 8 hours :o) )
3
9701
by: barbara_dave | last post by:
Hi all, I like to dispaly treeview node text with several columns as window explorer does and put buttons on the top. When I click a button, the nodes text can be sorted by date, file size, etc. Is there a way to do that?
20
2619
by: windandwaves | last post by:
Hi Folk I am a PHP programmer, but I like to learn c-sharp as it seems to be in hot demand around here. My questions are: - how does c-sharp relate to PHP - do you like c-sharp and its cousins - are there better things to do then c-sharp? Thanks a million
0
9561
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9381
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9332
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9254
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8252
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6799
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3316
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.