|
jdunlap:
You can email me the code on: java2@mail.dk
Thanks
|
|
|
|
|
Hi All
I am converting am App from Visual DataFlex to c#...
I need to have global function keys (like pressing F2 to save a record), but these keys must be available to a form at all times.
I also need to use the Enter key as a next Tab in all controls on a form.
I tryed KeyPress, but it does not trap Function Keys...
Thanks
Riaan
|
|
|
|
|
Hi Riaan,
set the form's KeyPreview property to true and take the KeyUp event for all control keys you want to trap.
Dave
|
|
|
|
|
If these commands are menu items, check the Shortcut property on each menu item. This ties into the accelerator key for that command.
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
How can i make the label Text or the Button Text appear Vertical instead of the default Horizontal?
|
|
|
|
|
There's no property that helps you doing that. You have to draw the text on your own. Look at the MSDN library for the Graphics.DrawString method to see an example.
Greets,
Dave
|
|
|
|
|
I'm new with attributes in c#
List say I have like the example on here
[Test("ID")]
public string ID
{getters and setters}
if I have a method load that loads data I want to map the column ID directly to the property.
I guess what I'm saying is by calling the attibute named "ID" and it would be pointing to the address of the property?
Does anyone have any pointers, I'm lost.
thanks
nick
|
|
|
|
|
by the way thats a SqlDataReader mapping a datarow to an object
|
|
|
|
|
using System;
using System.Reflection;
namespace SolidAvatar
{
public class TestAttribute : Attribute
{
private string m_FieldName;
public TestAttribute(string fieldName)
{
m_FieldName = fieldName;
}
public string FieldName
{
get
{ return m_FieldName; }
}
public static string GetFieldValue(object candidate, string fieldName)
{
System.Type type = candidate.GetType ();
foreach (PropertyInfo propInfo in type.GetProperties())
{
object[] attribs = propInfo.GetCustomAttributes (typeof (TestAttribute), true);
if (attribs.Length > 0)
{
TestAttribute testAttrib = (TestAttribute)attribs[0];
if (testAttrib.FieldName == fieldName)
{
return (string)propInfo.GetValue (candidate, null);
}
}
}
return string.Empty;
}
}
class MyClass
{
[Test ("ID")]
public string ID
{
get
{ return string.Empty; }
set
{}
}
public static void Main()
{
MyClass myClass = new MyClass ();
string idValue = TestAttribute.GetFieldValue (myClass, "ID");
}
}
}
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
a) any general info / links on performance comparison greatly appreciated
b) comments on the following?
I've been comparing GDI vs. GDI+ for one case: drawing a N point PolyLine.
For a fairly large number of points, GDI+ takes about 4x the time of GDI. (for a few points it's about 10x)
Transforms don't seem to affect the time, a float point array actually seems faster, The graphics.PageUnit is set to pixels, Pen is width -1 (aka one pixel)
Well, it could be worse, but a factor of 4 still seems though for me. Any idea on how to improve performance?
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Lack of performance is not due to the code being managed since the System.Drawing namespace does direct interoped GDI+ calls, and then GDI+ manage everything.
In addition, I believe GDI+ has a few of complex rendering modes being introduced, such as anti-aliasing. It's possible that even if you don't use anti-aliasing the loops have a few if()then() that, once intensively iterated, just cause what you see.
In fact, desassembling the stuff would give the answer.
I happen to start to work (personal project) on that topic sometimes near in the future. And indeed, I will have to decide whether GDI+ can be a good basis, or if I'll Bresenham all that stuff (know what I mean!). Will see if I post a few results.
|
|
|
|
|
Stephane Rodriguez. wrote:
know what I mean
absolutely, I did graphics programming back when video memory wasn't linear
Thanks for the info. Would be interested in any findings.
Related question - do you have any ideas/infos about merging .NET and "classic" GDI?
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
peterchen wrote:
Related question - do you have any ideas/infos about merging .NET and "classic" GDI?
This guy, which has eaten the pill two months ago, has written a book[^] in interop, and provides the preinteroped GDI32 library on the CD-ROM.
|
|
|
|
|
GDI+ does not currently make use of any hardware acceleration that may be provided by your video card driver. Later versions most likely will - but not the current release.
http://www.bobpowell.net/why_so_slow.htm[^]
--
Russell Morris
"Have you gone mad Frink? Put down that science pole!"
|
|
|
|
|
|
Hey All,
I need to test a network connection to local lan using a PDA with
wireless capabilities. I am using c# as app language.
How can I test for connection? I am looking for something that I give the net share name and it brings back a success or failed in connecting.
Need to know exception thrown by the command as well.
Thanks,
JJ
|
|
|
|
|
Hey JJ,
First of all, are you just checking your general connection? If so, just connecting to the internet through the lan would be a good test that your actually connecting to the network. I and another developer are currently in the process of writing a sync server client for a pocket pc device that handles wireless connectivity. Otherwise, you could write a small little csharp server that uses a socket object, and sits and waits for you to connect from your device. It's pretty simple really, there happens to be about 500 examples on www.devbuzz.com. I would suggest checking out that site.
Ryan
|
|
|
|
|
Hi Ryan,
Thanks for the reply. I found that through Dns.GetHostByName(DomainName) I can call and see if connection is available if it comes back as No suck host exist, I know that Lan is not in range.
JJ
|
|
|
|
|
My wife has asked me to write an app that will call her cell phone and when she picks up, "speak" a prerecorded message into it. It would be nice to detect if I get her voice mail, so I can press # and then leave the same message there.
I'm not sure how to do this. I've already prepared the message into several MP3 files on my computer. I can use C++ or C# (preferrably), but I don't know what libraries to use for making the phone conversation happen. It would also be nice if I could somehow make the call through an Internet connection, but if that's too complex, I'll settle for dialing out through my modem.
I appreciate any guidance.
Regards,
Alvaro
If you want to get to the top, prepare to kiss a lot of bottom. -- despair.com
|
|
|
|
|
I have to use some control to parse ans show html tags for me, so I decided to use Microsoft Web Browser control, which has a method named Navigate (string url ) that navigates us to the specified url at run-time. But this control hasn't any property like Text or for example Source . therefor, if i generate my html tags at run-time I should first save it as a temporary *.htm file and pass its url to Navigate method! Of course there may be some better way to meet my need, but I don't really know what should I do!
and there is also another component named Microsoft Scriptlet Component
that is not usable for me at all!
Your comments are greatly appreciated!
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Reference mshtml.tlb in your project.
Use this code to get the HTML content.
IHTMLDocument2 doc = (IHTMLDocument2) webBrowser.Document;
string text = doc.body.outerHTML;
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
I used innerHTML and it worked for me.
Thanks a lot!
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Hello
I have a programe which fetches it's data (video, audiu, images, ...) from CD on CD Drive. So my programe needs to obtain the name of CD Drive (i:\ ? j:\ ? ...). and also needs to detect whether the correct CD containing required data is in drive or not. whould someone please help me?
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Hi Meisam.
I email you your answer:
GetDriveType()
Mazy
No sig. available now.
|
|
|
|
|
Hello everyone,
i'm quite new to this c# world so please bear with me
So I have this form and in it I have an editbox in which I must enter a number, in the following form : 119.43. Now, I need this string to be converted to float. Here's how I do it :
float p = System.Single.Parse(prixS);
BUT, I always get a string not properly formatted exception. I tried entering the price with a comma, no can do. Than I tried this :
prixF = (float)System.Single.Parse(prix, System.Globalization.NumberStyles.AllowDecimalPoint| System.Globalization.NumberStyles.AllowTrailingWhite| System.Globalization.NumberStyles.AllowLeadingWhite);
But again same error.
Can someone please help me on this.
Thanks for any help.
Luc.
|
|
|
|