|
Hey !
In VB we can easily access the Application object. This is also available in MFC as AfxGetApp().
What is the C# .NET equivalent?
|
|
|
|
|
Hello, I want to make a dialog with a given size for pocket pc.
For doing that I have derived my class from System.Windows.Forms.Form and I have set the property Size for my form with my prefered size. But the result is not what I have expected.
Do you know what can be the solution for my problem?
public class SelectionTool : System.Windows.Forms.Form
{
public SelectionTool(String title, String lblText){
InitializeComponent();
}
private void InitializeComponent()
{
//that line of code doesn't set the size for my form
this.Size = new Size(20,40);
.....
this.ShowDialog();
}
}
Ramona
|
|
|
|
|
I am C# beginner. I just started to practise
on console aplications.
And I already have problem.
How to supply C function _getch()
i.e. Get a character from the console.
Thanx
viliam
|
|
|
|
|
Your best bet is probably to write a DLL in C that performs any low-level input, then use the Platform Invoke feature to access that.
You can also P/Invoke _getch directly.
[DllImport("msvcr71.dll", CallingConvention = CallingConvention.Cdecl)]
static extern int _getwch();
[STAThread]
static void Main(string[] args)
{
Console.WriteLine( "Press any key to continue" );
Console.Out.Flush();
char ch = (char) _getwch();
Console.WriteLine( "You pressed {0}", ch );
} You must call Flush , because the Console class performs buffering on the stream. Failing to do so can cause the prompt to be displayed after _getwch executes, not before.
Note that I used the wide-character version, _getwch, because the CLR uses wide characters internally.
|
|
|
|
|
What about Console.Read() ? Doesn't that work?
|
|
|
|
|
|
Oh ok... I guess I missed the point of the post.
|
|
|
|
|
Actually I don't think you did... I'm sure he just wants to read some character from the console...
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
Hi,
I would enjoy playing a short custom sound with C# (like a beep) when the mouse moves over a button for example, like Ineternet Explorer does.
Would anybody help me ? Thanks.
|
|
|
|
|
Use managed DirectX or use P/Invoke to call the play sound method in the Win32 API.
The graveyards are filled with indispensible men.
|
|
|
|
|
Hi all.
I'm trying to set the IP of my NIC's. I have found nice examples showing how to get the IP through the WMI, but how can I set it?
All hints are appreciated.
Regards,
Christian Sternell
|
|
|
|
|
As far as I know, you can't without going through the natice API, and configuring it with no DHCP, and then setting a static ip address.
"Je pense, donc je mange." - Rene Descartes 1689 - Just before his mother put his tea on the table.
Shameless Plug - Distributed Database Transactions in .NET using COM+
|
|
|
|
|
Thanks for the answer, Giles.
That was a little discouraging, but I'll see what I can do about it.
If anyone out there has a piece of code for this - please post if for me.
Regards,
Christian Sternell
|
|
|
|
|
I'm pretty sure I had a friend do it in C++ once using WMI (NetworkConfiguration class). If you can do it in C++, I would assume you could wrap it in C#.
|
|
|
|
|
Can I compile my c# application under MacOS-X?
Bye, Roberto Ferro
|
|
|
|
|
Yes and no.
If your application contains no GUI then you can most likely compile the appliaction for Mac OS-X. However you'll need a different version of the .NET Framework to compile your code. Check out www.go-mono.com[^]
If your application contains any GUI code then it will be much less likely to work with Mono
Jared
jparsons@jparsons.org
www.prism.gatech.edu/~gte477n
|
|
|
|
|
jparsons wrote:
Check out www.go-mono.com[^]
Mono only runs on windows and GNU Linux!!!
Get Portable.NET, runs on anything
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Probably 2 choices , Mono by Ximian, or Rotor, which is a shared source implementation by Microsoft that compiles on Windows XP and Free/Open/Net BSD Unix's.
Mono on Linux makes use of Wine to do the GUI bit, though I have no idea about Rotor.
"Je pense, donc je mange." - Rene Descartes 1689 - Just before his mother put his tea on the table.
Shameless Plug - Distributed Database Transactions in .NET using COM+
|
|
|
|
|
|
|
The application created with Portable .NET runs under OSX, but the compiler runs only under Linux. Is it true?
|
|
|
|
|
|
My datagrid is binded to a table in database but I don't want that all column shown in datagrid.How can I do it?
Mazy
No sig. available now.
|
|
|
|
|
Uncheck 'Auto generate columns' and then manualy add bound columns using the property builder.
HTH
Ryan
|
|
|
|
|
Hi
I want to create a custom edit box, but because it is not allowed to overwrite
its OnPaint() method I cannot derive my class from edit box class and I have to write it from scratch, but the problem is how I can make a custom control
editable.
Thanks in advance
S
|
|
|
|