|
Works fine here; perhaps the filename was mistyped?
James
|
|
|
|
|
I have made a windows form in C# and I want it to permanently be displayed on the computer desktop.All other applications should have open under it.What I mean is that any application which opens should have the desktop area below my form available to it.
My form is a small strip.
|
|
|
|
|
|
With top most property the form will become the top- level window.I want this top level window to be dockable to the desktop.Something like the APPBAR.
|
|
|
|
|
|
Hi,
I wrote a multi-threaded application that sends/recieves documents on a scheduled/event driven basis. It works fine as a console application the files are being sent and the CPU usage is around 30%. My problem is when I have the exact same code in a Windows Service application. When the service is using one thread to send documents it also works fine, but if there is more than one thread running at one time the CPU usage shoots up to 100%. Could someone please help me?
Thanks
P.S. The applcation is also using the System.Timer and File System Watcher.
Thanks Again,
Aisha
|
|
|
|
|
I am writing a client/server application with the server running on Linux written in C++ and the client application running on Windows XP written in C#. I am sending JPEG images over the network from cient to server and am getting some very odd behavior. It appears that after each JPEG I transmit I get about 1 - 3 packets containing 1 byte of useless information. Is this something with BinaryWriter that is it sending additional informaiton about what it sent?
Thanks,
Steven
|
|
|
|
|
I need to have a multiline textbox with a passwordchar. I know that the passwordchar property will not work in multiline mode. So, I figure on capturing the keypress event to create the same effect but there is one problem: -
I can't figure out how to substitute the '*' character for the key pressed. Everything is read only.
Thanks,
Bill Ferreia
|
|
|
|
|
every time you enter into the textbox, the TextChanged Event is called, maybe u could do something there?
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
Say you have two projects written in different .NET languages (C#.NET, MC++.NET) How do you reference the classes of the MC++.NET in the C#.NET project?
I don't have any problems importing the projects into the solution, but I can't figure how to reference the classes.
Thanks,
Bill Ferreira
|
|
|
|
|
is the MC++ code in a DLL? im not sure if you can then just reference it as u would a c# dll - ull have to try.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
How do I center a message box to my application form. I have tried passing the application form as the parent of the message box but it still appers centered to the desktop.
MessageBox.Show(myForm, ...);
Joel
|
|
|
|
|
I need to know if there is a vertical scrollbar in a listbox. there is a bool HorizontalScrollBar property, but not a bool VerticalScrollBar
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
You have ItemHeight (in pixels) and Height of the control... so you can try something like:
<br />
bool bVertScrollBar = lb.ItemHeight * lb.Items.Count > lb.Height;<br />
Just take into account that you can change the units of your form (with AutoScaleBaseSize).
-- LuisR
p.s. And take into account that the horizontal scroll bar could be displayed also, thus reducing the height of the display area.
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
thats sort of what i did - except there is a property called PreferedHeight thats does your multiplication for you, and its better to use it, because not all the items in the listbox are the same height.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
I am interested in returning a value by reference so that if it is an ArrayList when I make changes to it, the changes are permanent.
Now this is totally possible in C++ and I used to do it all the time.
ie. public &int Class1::Foo()
This must be possible in C#, is there something I am missing?????
Thanks very much...
|
|
|
|
|
you can do the same thing is C# - except, you have to declare the code as unsafe
e.g.
unsafe public &int Method()
and you need to compile with the 'comile unsafe code' compiler switch. I believe it is like this because when you do this, you are overrideing the .NET memory management, so you are handling the memory yourself or sumpthin.
p.s. to use it in normal code, just do this:
...
unsafe
{
....
}
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
if you simply want to pass an ArrayList to a function which modifies the properties and such of that ArrayList, just pass the variable, no need for anything fancy.
if you want to pass an ArrayList to a function which has the ability to actually change the reference, add a "ref" modifier to the parameter of the method calls, both in the signature and in the call.
or are you trying to do something else?
|
|
|
|
|
Hie...to all,
I don't know why I can't run my application which I wrote it using C#.NET.
When I bring it into the Windows 98, I can't execute the program. Please advice me?
Thank you!
Aaron
|
|
|
|
|
DotNet wrote:
I can't execute the program
What do you mean by "can't execute the program"?
Do you get an error message? Blue screen? What happens?
James
|
|
|
|
|
I don't know the exact problem but did you installed the .NET Framwork?
|
|
|
|
|
Hi,
I'm wrting a custom control that will use theme library to
draw my control. But whenever I call OpenThemeData, all that
I get is a NULL theme handle. Is there any trick to do before
calling this function?
I saw one guy posting the same question a couple months ago
and sought no answer.
I also read James T. Johnson & akr0's discussion on this issue.
However, not quite understand what James mean by using P/Invoke.
What's P/Invoke? (I know it may be a dump question, but I'm a
beginner...)
Any help will be appreciated. It would be better if you can
provide a code snippet to illustrate. Thanks
|
|
|
|
|
Li-kai Liu (Angus) wrote:
I'm wrting a custom control that will use theme library to
draw my control.
Unless you are doing something special the "easy" thing to do is to create a manifest file for your application and set the FlatStyle of your controls to FlatStyle.System .
If you want to go this route, Chris Sells' website[^] has a manifest file for VS.NET, you can use this same file for your application just rename it to myapp.exe.manifest.
That said, on to your other question.
Li-kai Liu (Angus) wrote:
What's P/Invoke?
P/Invoke is a method of executing functions from a C-style dll in a .NET program.
The first step is to declare the function you wish to use and the file that it is in. I'll use OpenThemeData as an example. There is a step embedded in this first step, in that you have to convert all the types used into .NET equivalent types. This is something you learn with practice and time.
[DllImport("uxtheme.dll")]
public extern static IntPtr OpenThemeData(IntPtr hwnd, string pszClassList);
Note that since the second parameter is a wide string (unicode) I could just pass the string in directly and not have to involve the MarshalAs attribute.
For more information look up the DllImport and MarshalAs attributes up in MSDN. If you have to pass structures around you'll probably also need to look at the StructLayout attribute.
HTH,
James
|
|
|
|
|
Hi, James
The thing you addressed in the second part using P/Inovoke
is what I've done in my program. But it's still not working.
I've already had my unmanaged function declared as you did
in the post. And it looks to me that OpenThemeData doesn't
work as it should do. I had another uxtheme API
static public extern bool IsThemeActive();
It works very well. But just don't know why OpenThemeData
always return Null whenever I call it.
Part of the code in my control is as follow:
protected override void OnPaint(PaintEventArgs pe) {
IntPtr hTheme = OpenThemeData(this.Handle , "button");
if (hTheme != IntPtr.Zero)
{
// draw themed control
}
else
{
// draw normal control
}
}
However, OpenThemeData always return Null...
Am I doing right with this?
Thanks!
|
|
|
|
|
I think it is a result of using OpenThemeData incorrectly; but the docs aren't that clear on how it should be used.
I only have one suggestion and it isn't a very good one. Put the class name in all caps ("BUTTON") or try "Button"
I tried to download the MSDN sample app but I just got a 404 instead
James
|
|
|
|