|
Well Dear!
i m using 3 monitors with windows xp sp2 professional. i want to write a program in C# which forces all of three screens to use same resolution overwriting their individual resolutions and on exiting from application resumes their individual resolution back. plz help me how to do some guidance ?
Thanx
I M new in .net p
|
|
|
|
|
I'm pretty sure you cannot do that in C#. You should search a Win32 DLL and use it with PInvoke or DllImport.
try here www.pinvoke.net
[ITA] Tozzi ha ragione: Gaia si sta liberando di noi.
[ENG] Tozzi is right: Gaia is obliterating us.
|
|
|
|
|
hi all,
How am I open Excel File page on windows Form?.Is there a library to Load Excel file and read it using C#?
thanks in advance.
|
|
|
|
|
Why dont you at least try to use the search[^] function?
You'll find plenty of hits which basically seperate into those who use automation and others that use Ado.Net. Which one is better depends on your requirements.
|
|
|
|
|
Hi :
How can I darg-drop item to a WebBrowser control ?
I created an application written by C#,it includes two forms , one form
includes a TreeView control , the other includes a WebBrower control and a
TextBox control, now we call them as Form1 and Form2.
First , I try drag a item to the TextBox control,(I have set TreeView for
drag well ) I set
"this.textBox1.AllowDrop = true;" then add Events and write these methods:
this.textBox1.DragOver += new System.Windows.Forms.DragEventHandler
(this.textBox1_DragOver);
this.textBox1.DragDrop += new System.Windows.Forms.DragEventHandler
(this.textBox1_DragDrop);
this.textBox1.DragEnter += new System.Windows.Forms.DragEventHandler
(this.textBox1_DragEnter);
Run this application,and drag item from TreeView which in Form1 to TextBox
which in Form2,the TextBox 3 Events (DragOver,DragDrop,DragEnter) is done
well.
But when I want drag item to the WebBrower,I can not find DragEnter Event and
others Events related to "Drag-Drop",so I can not drop Item to WebBrowser.
Also I have tryed set WebBrowser's Document.DesignMode="On",but can not drop
too.
Then I Write a HTMLBody's ondragenter Event ,but this ondragenter() can not
trigger.
So I think it must be solved by COM knowledge.
Can any one give my some suggestion,
because my COM knowledge is poor, if anyone give me an all solved code ,I
will be very appreciated.Thanks very
|
|
|
|
|
Grettings All,
I am not familiar with Virtual Dispatching, I know only concepts.
Could some guide to a good atrcile about virtual dispatching or explain in details the benefits of virtual dispatching.
Thank you
Sincerely,
Max Pastchenko
|
|
|
|
|
|
I'm looking for feedback if the following makes sense:
- I declared an Interface IDocument:
public interface IDocument
{
bool IsDirty { get; }
void Save(System.IO.Stream stream, bool resetDirty);
void Load(System.IO.Stream stream);
}
A Helper class implementing the Open/Close/Save/SaveAs/AskForFilename UI should work wiht the document(s) through this interface.
I'm a bit uneasy with the Load/Deserialize design: DeSerialize returns an objec. This makes sense but:
- I can't have a static Load method in the interface
- doesn't allow to implement "Revert"
So I did implement Load the following way:
public void Load(System.IO.Stream stream)
{
System.Xml.Serialization.XmlSerializer ser =
new System.Xml.Serialization.XmlSerializer(typeof(RTDocument));
RTDocument loaded = ser.Deserialize(stream) as RTDocument;
Root = loaded.Root;
}
Is this exceptionally stupid? Some better way?
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
|
Yeah, I arrived at that point, too.
I *think* it can be does by constructing a generic Document Manager just using the typeof(document).
Q: is it possible to override the default "[Serialize]" imlementatìon?
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
Q: is it possible to override the default "[Serialize]" imlementatìon?
Sure - inherit from ISerializable and then override the GetObjectData(SerializationInfo info, StreamingContext context) method. You may also need to supply a special constructor for your class (protected MyClass(SerializationInfo si, StreamingContext context) ) - MSDN has conflicting info on this (see ISerializable[^] and Custom Serialization[^])
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|
|
What's the "good thing" to prefix private members?
example:
public bool IsDirty { get { return ??sDirty; } }
private bool ??sDirty;
m_ seems to be discouraged. As I understand, using lowercase isDirty is not a problem for private members - but what do you do?
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
I use uppercase for public, lowercase for private. To be CLS compliant, if you have a private member and you want a public property, you can't do this, because CLS compliance takes into account VB, which is crap and is not case sensitive. Instead, the recommmended syntax is to prefix with an _.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I use uppercase for public, lowercase for private. To be CLS compliant, if you have a private member and you want a public property, you can't do this
Not true (for C# anyway - VB is another story ) - if you mark your assembly with [assembly: CLSCompliant(true)] and then do something like this
protected string hello;<br />
public string Hello<br />
{<br />
get<br />
{<br />
return this.hello;<br />
}<br />
}
the compiler throws a fit but if you change
protected string hello;
to
private string hello;
everything works fine. I do all my coding in C# this way and VB doesn't have any problems using the assemblies
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|
|
Interesting, I always use private over protected, but I've definately had to mark some methods as not CLS compliant in order to keep this approach. I wonder what was different ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I'd do the same as Christian (I loathe hungarian notation )
"I think I speak on behalf of everyone here when I say huh?" - Buffy
-- modified at 7:07 Friday 2nd September, 2005
|
|
|
|
|
Hi
I have a treeview where I implemented drag and drop functionality; however, if there are many nodes, when I start dragging a node and put the cursor on the bottom edge of the control, scrolling downwards works (I assume it's a built in treeview feature), scrolling upwards, on the other hand, doesn't. How do I implement scrolling up functionality for drag and drop?
Thank you in advance.
-- modified at 16:22 Thursday 1st September, 2005
|
|
|
|
|
You can use node.EnsureVisible() to make the control scroll some node into view. Using this, you should be able to achieve scrolling.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
I'm trying to bash my stubborn head through the .NET/ C# wall with a little project. before I start, I'd like to ask:
Can the following be done with reasonable effort:
- pretty heavy List Control custom draw
- Getting a DLL's version number
- Using WebForms for an app that can run both as Standalone Client and as a server-based application?
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
peterchen wrote:
pretty heavy List Control custom draw
Yep, custom drawing is a common practice, and I don't see why you couldn't do your own list control. Keep in mind though, it's better to reuse existing control, overriding only the parts you need. Writing a control from scratch, though it seems fairly simple, is quite the large task in the end.
peterchen wrote:
- Getting a DLL's version number
Yeah, sure:
using System.Reflection;
...
Assembly executingAssembly = Assembly.GetExecutingAssembly();
AssemblyName assemblyName = executingAssembly.GetName();
Version assemblyVersion = assemblyName.Version;
peterchen wrote:
- Using WebForms for an app that can run both as Standalone Client and as a server-based application?
I'm not sure why you'd want to do this. A WebForms app as a standalone executable and as a server app (are we talking console app?) This is probably unlikely, I don't think you'd want to do this. What you *could* do is create a web forms app, then build a simply Windows Forms app that contains the WebBrowser control from Microsoft. Navigate the browser control to your webforms aspx file, and voila, you have webforms running as a standalone client application. Again, I don't recommend this. Depending on what you're doing, there's likely a much easier way of accomplishing your goals, but you'd have to let us know what you're trying to do before I can help further.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
Thanks
Judah Himango wrote:
Getting a DLL's version number
Does that work for "normal" Win32 binaries, too?
Judah Himango wrote:
I'm not sure why you'd want to do this
Just an idea (You see, I don't have a good overview of whast's suitable with the individual technologies). The app would be useful both as standalone, and across the LAN, and I wondered if I could feed both with the same code base. But I don't want to put significant extra work into it, and the LAN part is sufficient with push-publishing static HTML, too.
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
peterchen wrote:
Does that work for "normal" Win32 binaries, too?
I believe the reflection stuff is for .NET CLR assemblies only. There's probably a way to find the version number of Win32 dlls as well, most likely as part of the System.Diagnostics process (for instance, you can get the version number of a dll using the System.Diagnostics.ProcessModule class).
peterchen wrote:
Just an idea
If you mean inter-computer communication within a LAN, I'd use either .NET remoting or web serivces. Remoting is quite a bit faster than web services, but less portable and is for .NET-to-.NET communication only.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
There's probably a way to find the version number of Win32 dlls as well
You can PInvoke and use DllGetVersion
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|
|
There is actually a trick on using ASP.NET applications as standalone - you would need to write a small .exe which hosts the ASP.NET Runtime. I believe the article can be found in the MSDN Magazine (not 100% sure though...)
----------------------
~hamster1
|
|
|
|
|
Hi, I need help with this. I added a xml file into my project. Now, in one class i need to acces it so i can process the data in it. How can i do this? how can i get the path of it so i can access it?
Thank u so much, i would help me a lot...
|
|
|
|