|
Thank you ,I think you do not understand my means.
I want to head off API functions.I saw the article age,
it is a article about rewrite Memory.In my opinion,that is
a part of it.
sorry for my poor English
sdfasd
|
|
|
|
|
veryu sorry to ask such a stupid question here...but i am trying to learn C# on my own.so i will be very thanksful if someone could answer my stupid ques..
i made a new app with C# and chose windows application at the project...
now i got the project..there is one form present...
now in old VS i go to class wizard and add the OnPaint() handler...
how do I add the OnPaint() handler in VS.Net???
can someone pls tell how to add a event handler???
do i have to type the whole thing everytime???
can someone pls help me??
tks...
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
"For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."
John 3:16
"Therefore you also be ready, for the Son of Man is coming at an hour you do not expet."
Luke 12:40
|
|
|
|
|
First, you should understand what happens to the code since VS.NET merely manipulates code and other resource files. Dragging and dropping is hardly "programming". .NET uses an event handler system that is easy to understand and - many times - can't be hooked up using the designer.
To use VS.NET to do this, though, use your Property Grid to switch to events (the first couple of buttons at the top of the Property Grid show properties or events, respectively). Find the Paint event and either double-click it, or type your own event handler method name and press Enter. Like VS6 and below, it will jump you to the method block to begin writing code.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
i dont know hwere is the property grid...how to find it???which one is it???can u pls tell me...tks a lot...i have been looking for property grid for very long....
can u tell me which one is it??how to find it???
tks a lot./..
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
"For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."
John 3:16
"Therefore you also be ready, for the Son of Man is coming at an hour you do not expet."
Luke 12:40
|
|
|
|
|
As with practically every other Windows application, right-click on an object in your form (or the form itself) and click "Properties". The property grid will recieve the focus. It is also on by default and should be obvious. It's always there as a docked Window but can be undocked. You should read the product documentation if you're unsure.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Is there a way, I can Disable Font Style(Bold, Italics etc) and Font Size from Font Dialog box in C#.
|
|
|
|
|
Not properties and methods in .NET, no. You'd have to P/Invoke SendMessage and GetWindow . You'd then have to call GetWindow several times with the right params (which you should define as consts or an enum - see the native GetWindow documentation in MSDN) to get the two controls you want to disable. This is also risky because this common dialog may change in the future, thus throwing the controls possibly out of an order you've defined. You could just enumerate them all till you find two windows of the right Windows class (which means more P/Invoking). Then you can call SendMessage(handle, WM_ENABLE, false, 0) , where handle is the Window handle of the each control.
A better way to handle this would just be to define your own dialog which includes only those things you want. You can make it robust like the FontDialog so that it accepts a Font from which to initialize the form's values, and returns a Font created from the old Font (as the template) with the new attributes selected in the dialog. This is just like the FileDialog.Font property.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
hi All,
This problem is for C# windows application.
I have a user control whcih contains one picture box along with other
controls.
Depending on certain conditions I want to change images on the picturebox.
But at the same time I want to refer only assembly of the user control in
other solution.
If I am using method System.Drawing.Image.FromFile("filename") I have to put
gif files containing those images in bin directory of solution in whcih I am
using user control.
But I don't want that.
I want that only assebly needs to be referenced.
Is there any way for this.
If yes please send code snipet.
Thanks
Shailaja
|
|
|
|
|
If you mean embedded resources in a .NET assembly, then embed resources in the assembly from which images can be selected, then use the Bitmap(Type, String) constructor. The Type parameter should be a type that has the same namespace as the embedded resources (in a mannger of speak), and the String should be the name of the resource that begins with the same namespace. See that constructor documentation for more details.
You can also create an image from a stream, which means you can use Assembly.GetManifestResourceStream to get a Stream for the embedded resource, which you then create an image from, and assign that to PictureBox.Image .
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi Heath,
thanks for your input.
I did not get what you have suggested in 1st para.
What I did is I embedded the resources by changing their build property to embedded resource. And I tried to get the required resource from Assembly Manifest by using statements
System.Reflection.Assembly thisExe = System.Reflection.Assembly.GetExecutingAssembly();
System.IO.Stream file = thisExe.GetManifestResourceStream ("ShapeLibrary.5side_Equipment.gif");
baseShape1.PropDisplayImage = Image.FromStream(file);
While I am trying to compile the project getting this exception message
" An exception occurred while trying to create an instance of ShapeLibrary.BaseShape. The exception was "'null' is not a valid value for 'stream'.".
Whereas "ShapeLibrary" is name of assembly containing Embedded resources. BaseShape is the user control in this Library in which I am putting image from this perticular code above.
For that I have written public property which sets image on the picture box.
Have I missed anything?
Regards
Shailaja
|
|
|
|
|
If you're getting that error while compiling, the code above has nothing to do with it. It's not JIT'ed and executed during compile-time, only at run-time. And the name of the assembly doesn't matter when resolving the embedded resource per se. If you're using VS.NET, the resource will contain the base namespace (configurable in the project properties, which is defaulted to the assembly name) plus dot-separated namespaces for each folder the resource is in (for source files, the namespace uses these as well for default namespaces), plus the resource name. If you're not sure about this, open your compiled assembly in ildasm.exe (the IL Disassembler, part of the .NET Framework SDK) and examine the MANIFEST file. Toward the bottom you'll see .mresource entries. Type the name into GetManifestResourceStream exactly as you see it there.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi
I noticed diffrence in the way these embedded resource files are described in assembly manifest.
Some are without '' and some within ''
Is it affecting the working of my code?
for Eg:
.mresource public ShapeLibrary.Sensor.gif
{
}
.mresource public 'ShapeLibrary.4side_Equipment.gif'
{
}
.mresource public 'ShapeLibrary.5side_Equipment.gif'
{
}
So should I use stringname = "'ShapeLibrary.4side_Equipment.gif'";
where as earlier I was not using ''?
I tried doing this but still the exception persists.
Regards
Shailaja
|
|
|
|
|
Again, are you getting this error when compiling your project, or when executing it?
And as far as the single quotes go, you should use them if they are specified there, but I'm curious how they got there in the first place. Check the resource name in the property grid when you select the file in your project that is the embedded resource and make sure there are no single quotes.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I am getting this error while compiling. I could not reach till execution stage.
Regards
Shailaja
|
|
|
|
|
Then you have a different problem than the name of the resource in your source code - that isn't checked by the compiler, except for syntax and type-safety. Having those single quotes in your resource names (for the project, not the code) could be causing problems for the assembler. Like I said in my previous post, try to figure out why the single quotes are there and get rid of them. You might have to manually edit your .csproj file, but it isn't difficult. Be sure to do a complete rebuild when you're finished to make sure the resources are properly embedded.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi Heath,
I checked csproject file also opening it in notepad.
The resource files having single cots in manifest are shown like pther files not having double cots.
if you don't mind can I zip the solution and send it to you?
Regards
Shailaja
|
|
|
|
|
Just send the csproj file. I shouldn't need the others.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hello,
is there a way to fill a String variable with the content of a stream ?
e.g.
XmlDocument.save() only allows writing to a stream. But I want the XML-Contents in a variable of type String
Thanx
|
|
|
|
|
Try and use:
- XmlDocument.OuterXml -> deliveres string directly
or
- XmlDocument.WriteTo
something like:
StringBuilder b = new StringBuilder();
XmlTextWriter writer = new XmlTextWriter(b);
xmlDoc.WriteTo(writer);
writer.Close();
return b.ToString();
|
|
|
|
|
StreamReader reader = new StreamReader(yourStream);
String s = reader.ReadToEnd();
|
|
|
|
|
Has anyone written code for bluetooth communication ?
I need to transfer data between a laptop and a Pocket PC via bluetooth.
Any help would be appreciated.
Johan Lombaard
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former - Albert Einstein
|
|
|
|
|
hi all,
i ve to create an application in which i can open graphical files(created in c#) into microsoft powerpoint. is there any way by which i can achieve this.
im very new to c#, so any help/ideas/suggestions in this regards will be highly appreciated.
thanks in advance
p123
|
|
|
|
|
If you're new to C#, then first learn that and don't start-off with such a hard problem. Providing an image format handler is an incredibly daunting task that requires many, many COM interfaces (and in .NET, these have to be redefined in managed code) and registry entries. If you merely need to insert a well-known image format (like GIF, JPEG, PNG, BMP, etc.), then add the Microsoft PowerPoint typelib to your project (right-click on your project, select Add Reference, then click the COM tab) which creates an interop assembly. Then you can use the PowerPoint object model to insert an image.
Besides, it might not even be possible since PowerPoint may be configured to only handle image formats that it was written and compiled to understand. In this case, you have to create an image viewer COM component and get into OLE (object-link and embedding) to display it in PowerPoint. Again, this is a very daunting task that is even difficult for those of us that have been using .NET for the last couple years.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I want to write a simple usb driver to read from a usb device, but I really have no idea how to do it. All I know is that it can be done through the Win32 API. Does anyone know how I can do this or knows of a sample I can view? Thanks in advance.
|
|
|
|
|
You won't want to try doing this from C#. Try the C++ forums.
|
|
|
|