Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
F

Frank Horn

@Frank Horn
About
Posts
54
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Generate missing XML
    F Frank Horn

    It's probably easy in XSLT 2, but if you're using XSLT 1 like most of us who are relying on Microsoft tools, avoiding duplicated xsl code ist hard. Using a workaround pattern I've sometimes applied in such cases it would look like this: Contents References This is not nice, and can be further refined, but the only way I know to avoid duplicating the logic contained in the for-each statement. I don't have the patience right now to adjust the tabs and spaces which don't look right in the preview. And please be aware that I just copied and pasted it from some old stylesheets of mine and your fragments and have not tested it. There may be syntax errors, but I'm sure you get the gist. And if any one points out a better pattern, I'll add my thanks to yours.

    XML / XSL xml html question

  • Memory usage problem
    F Frank Horn

    You may want to try GC.WaitForPendingFinalizers() as well. It's a perfomance killer and not recommended in most situations, but it could be interesting to see if it changes the memory usage you see in task manager.

    C# question performance help

  • Changing the value of text box at run time in .net 2.0 windows application
    F Frank Horn

    I guess you're setting the text from within the comport_DataReceived event handler, which the SerialProt object calls from another thread. Either you read up on threading, or you don't use the event but put a timer onto your form (or control) and poll the com port from the timer's Tick event.

    C# csharp help question

  • How can I convert garbled filenames (Chinese) to the correct codepage?
    F Frank Horn

    No, I have no support for Asiian languages installed. Anyway, if it's actually about encoding, did you try something like this:

    string source = "ûÓÐÈË¿ÉÒÔ½ÐÄ㱦±´";

    Encoding sourceEncoding = Encoding.Default;
    byte[] bytes = sourceEncoding.GetBytes(source);

    Encoding targetEncoding = Encoding.GetEncoding("gb2312");
    string target = targetEncoding.GetString(bytes);

    C# help question csharp workspace

  • How can I convert garbled filenames (Chinese) to the correct codepage?
    F Frank Horn

    That's interesting. I'm not sure what the problem is though. Just created a file named 没有人可以叫你宝贝.txt on a German XP (hope it doesn't mean anything nasty), and in Explorer it shows up as a sequence of squares. This looks like a system thing indeed, cause the file name is correct (as I can see when I drag it into Firefox, which shows 没有人可以叫你宝贝.txt in the address bar). Is this the phenomenon you mean, or do your files also have a different name? And if so, can you reproduce it?

    C# help question csharp workspace

  • How do you add a control to a usercontrol during design time? [modified]
    F Frank Horn

    Found something: read up on the ParentControlDesigner class http://msdn.microsoft.com/en-us/library/system.windows.forms.design.parentcontroldesigner(VS.71).aspx

    Windows Forms csharp visual-studio design docker question

  • How do you add a control to a usercontrol during design time? [modified]
    F Frank Horn

    I had that problem myself and I'm not sure what best to do. Maybe there is a trick we both don't know. If you don't have a user control, but a control derived from Panel, you can drop controls onto it at design time and they will be added. Also I think if you have a Panel on your user control, you can drop controls onto the Panel. So maybe you can just fill your user control with a Panel and go from there.

    Windows Forms csharp visual-studio design docker question

  • How do you hide parts of a usercontrol from the toolbar.
    F Frank Horn

    I think you can give those controls you want to hide an attribute

    [System.ComponentModel.ToolboxItem(false)]

    Windows Forms csharp question visual-studio help

  • My computer can't do basic arithmetic (or I'm doing something stupid)
    F Frank Horn

    The compilers understands the right side expressions to be integers. You only get a decent result with float aspectRatio = (float)1280 / (float)500;

    C# question

  • Check if a DLL is registered
    F Frank Horn

    If it isn't, Activator.CreateInstance will throw an exception when you try to create an instance of a class from the COM library. There can be other reasons for the exception of course, so if you want to make sure it's the dll not being registered, you can check whether the registry key HKEY_CLASSES_ROOT\FullClassName is there (FullClassName being the string you pass to Activator.CreateInstance).

    C# csharp database question

  • 64-bit Progress Bar Maximum?
    F Frank Horn

    Why don't you set the maximum to 100 and set the integer percentage value when it has changed? Setting the value a billion times will slow down your application anyway, and users won't see a difference.

    Windows Forms csharp winforms question

  • Tracing Invalidate calls (Windows Forms)
    F Frank Horn

    Can't you trap the calls from the overriden OnPaint() method? Or by overriding OnInvalidated()?

    C# question winforms performance help

  • Inheritance and constructors
    F Frank Horn

    but how do I get it to call both? You don't, cause you can only have on base instance, so you can't call two constructors. You'll have to put the code from both base class constructors into two protected methods and call each from the respective base class constructor, and call both from the derived class constructor.

    C# question oop help

  • Absolute to Relative Path
    F Frank Horn

    Unfortunatly .Net seems to have an ugly gap here. but others have had this problem before, and you may get an idea here: http://mrpmorris.blogspot.com/2007/05/convert-absolute-path-to-relative-path.html

    C# com

  • XSL copy-of problem!
    F Frank Horn

    In the article they suppress the id attributes with the help of a template which matches them but does nothing. I think you're looking for something like Haven't tried it out though; could be faulty, but I hope you get the idea.

    XML / XSL xml html regex help

  • XSL copy-of problem!
    F Frank Horn

    Starting to feel sort of responsible for your project... I'm not sure what the problem is this time though. What's the overall goal of your transformation? Do you want to a) copy all the B and EM tags of some HTML to a self defined XML( or HTML) structure, or b) reproduce a complete HTML with all B and EM tags having a set of attributes which may be missing in the original? When a: what's your target structure? When b: probably a little recursion is called for. http://www.xmlplease.com/xsltidentity might be a good link to start with.

    XML / XSL xml html regex help

  • XSL value-of output problem!
    F Frank Horn

    Have you tried copy-of instead of value-of?

    XML / XSL help xml question

  • Hide control inherited from a base form in a specific derived form, this at design-time !
    F Frank Horn

    You could derive in 3 steps: Form1 without the 4 controls Form2 = Form1 + 4 controls type 1 Form3 = Form1 + 4 controls type 2 and 7 forms derived from Form2

    Windows Forms help design question

  • Loading controls with a BackgroundWorker
    F Frank Horn

    Sorry, I never did this and only vaguely remember having read about it. Anyway, why do you need to load a control in the background? Usually loading a control doesnt't take so long that another thread makes sense. If it's because of many data or a huge image, you could load those in a (non-UI) worker thread.

    Windows Forms csharp tutorial design help question

  • XSL Nesting Problem!
    F Frank Horn

    You're welcome. In case you can read German or French, this is where I learnt it all: http://selfhtml.org/ I hardly ever use websites in my native language when it comes to software development cause anglophone sites are abundant and (when they have a forum) well populated, but this one is so good I took it on as my default HTML and XSL reference.

    XML / XSL xml html wpf regex help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups