473,473 Members | 2,134 Online
Bytes | Software Development & Data Engineering Community
Create 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 32815
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.MessageBox.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
Leo sajjad
4 New Member
Dear,


I have done this this problem was at the begining level of my coding with c#.

Well thanks i will ask you if i have any other problem with c # code.

Thanx
Apr 3 '09 #11

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

Similar topics

0
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...
0
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...
2
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
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...
4
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...
9
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...
5
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...
3
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,...
20
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
1
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...
1
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...
0
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...
0
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...
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.