|
The way to get better is by reading. In VS.NET's Help index type "Graphics.DrawImage" or search for it on http://msdn.microsoft.com/library[^]. This forum is for helping with specific problems, but only you can teach yourself what you need to know. Not even schools can do that - they merely give you the tools and training with which to start your real education.
Most of the .NET Framework SDK documentation includes samples that should help you. There's also hundreds of articles here on CodeProject, many of which explain how to draw in .NET (just keep your search limited to C# and .NET, which you can check in the search page). That's why this site exists: to help new - and even experienced - programmers.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Good day all…
I am experiencing a problem in using the Form Icon property. I have created a custom icon for my app and cannot display the icon (in the design view) by setting the property using the browse function. It displays properly in the properties view but not on the title bar. I get a default icon (on the title bar) of which I cannot determine its origin. This icon is not the system default icon.
Thank you very much in advance for your assistance
Have a great coding day.
Regards,
Tony D. Abel
|
|
|
|
|
Open your icon in the icon editor in visual studio (if the .ico file is not part of your project, add it to the project and then double click it to open it in the editor). In the icon editor, there will be an enlarged view of your icon. Right-click anywhere in that view (not on the icon itself) and select "Current Icon Image Types | 16x16, 16 Colors". You should now see the smaller version of your icon which can be edited. If you have not made any changes to this before, then that would explain why your small icon is the default icon.
Hope this helps.
Best Regards.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Good day Matt
Thanks for the assist. I was trying to load a 32 x 32 icon for the title bar.
After changing the icon to a 16 x 16 icon it became present in the form design view.
Have a great coding day.
Regards,
Tony D. Abel
|
|
|
|
|
Hi all,
I want to use RegisterWindowMessage for IPC in pocketPC 2003 ?
Is it possible ? I have tried it by C# but some classes needed are missing
in .NET CF, so I try to find to implement it in VC++ in pocket2003. So what is the corresponding command for register the window message in VC++ ?
Thanks
Patrick
|
|
|
|
|
Hi~
As the message windows instance created in c# not register the window class or window title.(not like C++). So how can i get the handler of a message window which written from C#?
|
|
|
|
|
Hi all,
How to create COM by C# ? I have searched but can't find detail enough information to create it, including the interface...etc.
And can I use the c# com in VB script in a html file ?
e.g. in the VB script, I will program it as,
Set comObject = new CreateObject("comObject")
Thanks
Patrick
|
|
|
|
|
I am currently working on creating a COM+ component using C#. I can't asnwer your question about calling it from an HTML file, however, I have successfully run my COM component from a VBScript on the command line. Do a search on google for System.EnterpriseServices.ServicedComponent (you will inherit from this class to create your component). You will find several articles online that explain how to do it. Once you have successfully created your component, you simply register it with the regsvcs command line tool. Then you will see it in the component services control panel. You then instantiate it from your script as you would any other COM component.
One thing to keep in mind is that while the API to do all of this seems pretty clear, in practice it proves very complex and confusing. I am currently having some problems myself that I hope to figure out soon. Anyhow, let me know if you can't get going. I'll help you out however I can.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Doesn't work as Console.ReadLine return a string:
int x = Console.ReadLine();
...
Console.WriteLine(x);
So how can I convert the string to int (or float or short and so on) ?
String object doesn't seem to have ToInt member either ...
I still can't belive I don't know this one ...
Regards, Desmond
|
|
|
|
|
|
int x = Int32.Parse(Console.ReadLine());
This one will also throw an exception if it isnt a number string
Yuvaraj N
|
|
|
|
|
int.Parse("1");<br />
float.Parse("1.1");<br />
double.Parse("1.123");
etc.
|
|
|
|
|
How do i get information about the Share folders in my computer
|
|
|
|
|
Does anyone know the correct way of marshalling inline multi-dimensional arrays?
I have the following structure that I want to reproduce in C#:
typedef struct tagMyStruct {
WORD Version;
char szName[3][256];
} MyStruct, *MyStruct;
Now if this was just an inline array:
typedef struct tagMyStruct {
WORD Version;
char szName[256];
} MyStruct, *MyStruct;
You do this:
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)] public struct MyStruct {
public int Version;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=257)]
public string szName;
}
But it is not, so it is not that easy. I have tried, without success:
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)] public struct MyStruct {
public int Version;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=257)]
public string name1;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=257)]
public string name2;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=257)]
public string name3;
}
Any ideas?
David M. Kean
My Blog: Managed from Down Under
|
|
|
|
|
How can I use a c# com object in c++? I've tried an example but everytime I call this" Edcont::Edcont_InterfacePtr p(__uuidof(Edcont::EdconClass)); " in the c++ .cpp file, the app just closes. Does anyone have another example that I can use? This is the place where got the example that I used
http://www.csharphelp.com/archives/archive281.html[^]
|
|
|
|
|
Create your C# component as a System.EnterpriseServices.ServicedComponent, register it with regsvcs, and call it as you would call any other COM component from C++.
Best Regards.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
|
Hi
Type of enum member is underlying type for the containing enum, then why casting is necessary on enum member?
DF
|
|
|
|
|
Diana Fernandez wrote:
Type of enum member is underlying type for the containing enum, then why casting is necessary on enum member?
Because it isn't the underlying type (even though the value might be physically stored as such), it is the type defined in your enum.
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
It so happens that I have a class named Poetic which is the rootelement. When SERIALIZED --using the XMLSerializer--the outcome should be:
<Poetic xmlns:xsi="http//www.w3.org/2001/XMLSchema-instance" xsi:noNameSpaceSchemaLocation="http://poetic.publisher.com/xmlcomm/poetic.xsd">
My Class declaration is:
[System.Xml.Serialization.XmlRootAttribute("Poetic")]
public class Poetic
{
// properties, methods and the like in here
}
When I serialize it comes out:
<Poetic xmlns:xsd="http://http://www.w3.org/2001/XMLSchema" xmlns:xsi="http//www.w3.org/2001/XMLSchema-instance">
So...
1. How do I get the xsi:noNamespaceSchemaLocation into the element using SERIALIZATION. I know the noName.. is part of the w3 spec.
2. How do I get rid of the xmlns:xsd="http://http://www.w3.org/2001/XMLSchema".
Thanks,
Guillermo Jimenez
|
|
|
|
|
Try the following:
[XmlRootAttribute("Poetic", Namespace="http://YourNameSpaceHere")]
class Poetic
{
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi,
I need to display Dynamic Report.For Ex,
Report Fromat is
S.no No of % Due to
Test1 TEST2 TEST3 TEST4 Total
Section1 10 1 5 6
Section2 15 3 6 9
Section3 20 5 7 12
In 'x' table ,
Group Section is there.Ex Group Section1,Group Section2,Group Section3.User will select the Group Section.
Ex they selected Group Section1.
Under Group Section1,we need to display Sections.For ex Section1,Section2 and Section3.
Depending on Section1 need to display Columns Test1,test2,test3 like that.
Now there is no value test2 and test5.So no need to display.
Depending on user Selection,It will be different.Now it's displaying all.Can u help me to do.
radsgr
|
|
|
|
|
Hello,
I have a DateTimePicker control with check boxes on a form (well, several, but the behavior is the same for all.)
In design time, I set the Checked property to false. And they appear without the check.
When I run the app, the control is drawn checked, altough looking in the debugger, the Checked property is false. Once I start clicking on the checkbox, it checks and unchecks correctly.
So, we have it with Checked==false and check drawn. If I click on the checkbox, the check is cleared, Checked is still false, and I get no ValueChanged event. If I click again, everything works as expected (Checked set to true , and ValueChanged event).
Is it a bug? or am I missing something?
Thanks!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Hi all,
Is Window messaging by using the RegisterWindow MEssage API in C# a good way
to perform messaging between IPC ? How is it compared to IPC by MSMQ and .net remoting ? Is RegisteredWindow Message supported on Window 98 and Window ME also ?
Thanks
Patrick
|
|
|
|
|
pyhtang1 wrote:
Is RegisteredWindow Message supported on Window 98 and Window ME also ?
Check out the documentation for the function in the MSDN Library[^] for questions like these. In this case - if you understand what RegisterWindowMessage does - the answer should be obvious. You can't send unique messages without registering them.
What's best? Whatever is best for your situation. If you're communicating between two managed applications, I would not recommend Windows messaging. Use .NET Remoting with a TcpChannel . In .NET 2.0 they are also adding an IpcChannel which, IIRC, uses named pipes. Both are pretty fast, though there's a little extra overhead for using a TcpChannel . You could even create your own channel like the IpcChannel now - .NET Remoting is extensible enough.
If this was a named application, you could use Windows messaging, global memory, DDE, and anything else you can think of (you can use these in .NET, but often the overhead of P/Invoking what's required and marshaling isn't worth the trouble; .NET Remoting provides a rich RPC experience, too).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|