|
The MessageBox class is defined within the System.Windows.Forms namespace. Assuming that your project has already included a reference to the appropriate assembly, just include it in the using statement:
using System;
using System.Windows.Forms;
namespace Learn.CSharp.MessageBoxTest
{
class MainEntryPoint
{
public static void Main()
{
MessageBox.Show("Console App", "Hello there!", MessageBoxButtons.OK);
}
}
}
|
|
|
|
|
Hi Nick:
The code snippet I provided was missing the "using System.Windows.Forms;" statement but the program I was running was not. The exact program that you recommend in your last response still has the same problem....
Regards,
Mark
|
|
|
|
|
Hi Nick:
This is just a "FYI" type of message:
I finally solved the mystery of the blank message box under .NET. A guy from "Code Guru" tipped me off:
The problem was McAfee Anti Virus V8.0. If you have buffer overflow protection enabled, this will cause the problem I described. Disable BOP or run a hot-fix and the problem disappears.
Cheers,
Mark
|
|
|
|
|
i am developing an application for my final year project, that generate barcodes. my problem is that i want to tell the program to draw a black bar when I enter the number "1" for example, or two black bars when I enter "2"...etc. Could anyone help ?!
Thanks in advance
|
|
|
|
|
|
Hello,
I'm developing an add-in for Word2003 and I have some troubles. I’m using VS .NET 2003 ->extensibility project.
The add-in works fine with the first document in Word I create/open but after It fails, the add-in doesn’t work anymore.
I’m looking for an add-in source code, to see why I always have the same problem, where is the mistake…
In fact all the events (OnConnection, OnDisconnection, etc) only fires with the first document created/opened.
All the source codes I found, didn’t worked…So I’m looking for a complete example source code (in c# .NET)
Do you know where I could find It? Or why does my add-in only works with the first “instance” of Word.
Thanks a lot,
Frenchy
PS: Sorry for my bad English :p
|
|
|
|
|
Are you performing any exception handling in your code? Try settings some break points and stepping through the code during execution to see where it's failing.
|
|
|
|
|
Yes I put try/catch everywhere, as I said, all the events(OnConnection, OnDisconnection, ...) only fire the first time.
All my code is in these events, that's certenly why it doesn't work.
The commandbar with the buttons I created in the "OnConnection" is still in the second document, but the actions, the code doesn't work.
If someone have a complete source code for Word add-in, please tell me where I could find It Or you can send me by mail; frechy@msn.com
Thanks
|
|
|
|
|
My boss wants me to develop an application to capture a live video stream from a local selectable video source, so for instance a web cam or a TV tuner, depending on the situation. He does not however want me using DirectX. Does anyone have any other suggestions as to how to do this. I was thinking of using the windows media encoder but that seems to be a little over kill. Any Suggestions?
|
|
|
|
|
Hello
You can try to use Video for Windows. But, as it said in MSDN :
"VFW was introduced in 16-bit Windows. Many of its features has been superceded by features in DirectX. For more information, see the DirectX documentation."
So, it's better to use DirectX.
What is the point of your boss ? Why it's not likely to use DirectX ?
Andrew
|
|
|
|
|
I wrote a program with c# and ms-sql 2000.To connection strig I put my server's name as usual.But when I want to try my program on other computer since the server's name changes the connection string have to be changed.Is there any way that prevent changing string every time I change computer or servername? Is there any way that connection string automatically updates it self?
|
|
|
|
|
show us the connection string you're using minus username and password if you dont want us hacking you
|
|
|
|
|
|
There is a probem , I am not working on web , I am working on windows app.
You tell me that it still works fine? if so pelase tell me more about it..like an example code..
Thank you very much..
|
|
|
|
|
You could store the connection string in an App.config file. This would allow you to simply call ConfigurationSettings.AppSettings["keyName"]; to read the value. There are issues with this though so you would at least want to encrypt you connection string or any other values you wish to store there.
|
|
|
|
|
Sorry Nick,
I didn't mean to repeat what you posted.
Hey don't worry, I can handle it. I took something. I can see things no one else can see. Why are you dressed like that?
- Jack Burton
|
|
|
|
|
No worries, glad someone else made the same suggestion.
|
|
|
|
|
|
Thank you very much for your understanding and all of yours help...
|
|
|
|
|
i tried to make a simple client server program, the server
enters the listening mode waiting for the client, then it waits forever while the client send its message, what really happens is that it hangs after client connection and it doesn't respond or display the received msg until the client closes (i used tcpclient and tcplistener)
hffhc vh
|
|
|
|
|
how do i deselect current cell in datagrid?
|
|
|
|
|
Hi,
I have a viewer that uses multiple TabPages to view groups of rectangular objects. I want to enable the user to drag an object from one tab page to another tab page. If the left mouse button is NOT down, the Tabcontrol's MouseMove, MouseEnter, & MouseHover handlers are called. However, once the left mouse button is down for the drag, these handlers are never called. How do I implement simple drag & drop between tab pages? The problem is I can't activate the target tabpage if the TabControl's or the TabPage's handlers are not called when the mouse rolls over the tab.
Any help appreciated,
Royce
|
|
|
|
|
There are several articles here covering drag and drop, here[^] is one specifically.
|
|
|
|
|
hi guys i want to strip ceartin information from between tags but they differ in some things:
1:
<b><a.*?>(strip this 1)</a></b>
2:
<b>(strip this 2)</b>
3:
<b><a.*?><b>(strip this 3)</b></a></b>
Using the same regex object(i.e one expression for all 3), it got to be....
i've tried this expression but dosn't work?!
<b>(<a.*>(<b>)?)?(.*)((</b>)?</a>)?</b>
please can any one help
regards
|
|
|
|
|
Hi all,
How to use DTS Flat file provider for reading a text file data and fill dataset.I know how to get using OleDB providers.But i do not how to use DTS Flat file to read a text file using delimiters and fill the dataset.
If body have any idea please reply back.
thanks in advance.
Sastry.
sastry ch
|
|
|
|