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
K

Karl 2000

@Karl 2000
About
Posts
23
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • textbox autocomplete return character keypress problem
    K Karl 2000

    After further investigation it turns out that auto complete only intercepts the keypress event for the return key. The keypress event gets fired appropriately with any other key. The other keyboard events such as keyup and keydown are unaffected by this issue so they can be used as a work around. If anyone knows more about this issue please reply.

    Karl

    C# help question

  • CheckListBox
    K Karl 2000

    Set the checked property of the checkbox to true.

    Karl

    C# tutorial question

  • textbox autocomplete return character keypress problem
    K Karl 2000

    Thanks for your reply. It doesn't matter if the text is chosen from the autocomplete list or the person is typing in something completely new. The return key never fires a keypress event anymore. Every other key fires the event. The return key instead causes the text to be highlighted. I am not sure what you mean by validating the text in the textbox before using it. I currently do not validate the text, anything can be entered in the box. Thanks.

    Karl

    C# help question

  • textbox autocomplete return character keypress problem
    K Karl 2000

    Hi, I was using the return character to evaluate the input of a textbox via the keypress event. private void textBoxInput_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == '\r') { e.Handled = true; } } After turning on autocomple the keypress event is no longer triggered when the pressed key is the return key. Does anyone know a way around this? Thanks

    Karl

    C# help question

  • creating dynamic classes
    K Karl 2000

    No need to be rude. Karl

    C# question database

  • inherited menu problem
    K Karl 2000

    I just converted from visual studio 2003 to visual studio 2005. The project I am working on has several forms that are inherited from each other, each form added some additional items to the menu of its base form. This worked fine before with vs 2003, but now when editing an inherited form's menu I get a message box that says "Cannot add a new item to this menu because it is inherited." The menu is declared as protected. Can anyone explain what is going on? Thanks Karl

    C# visual-studio question csharp help

  • declaring array dimension and type at runtime
    K Karl 2000

    Thank you for your response, I understand how all of this works, and was just wondering if c# contained anything I wasn't aware of. It appears I will have to continue doing it as I have been. ArrayLists and the other collections are simply not appropriate for what I am trying to do. The functionality they provide come with too much of a performance hit. The implementation of ArrayList is significantly different from what I am trying to do. ArrayList's power and weakness come from it being a list of references, and hence you can stick anything in there, at the expense of following the references. What I am looking for is a standard array (one continuous chunk of memory, with only one reference to the array itself). Thanks for your help and suggestions. Particularly your suggestion for easier transition over to the new capabilities that will be provided by 2.0. Karl Baum

    C# question data-structures

  • declaring array dimension and type at runtime
    K Karl 2000

    Thanks for your response. As I understand the ArrayList and all other collections provide lists of objects. My arrays will contain standard types such as byte, int, float... As a result if I use a collection there will be a large performance hit (boxing,unboxing,longer value retreval times). Thanks Karl Baum

    C# question data-structures

  • declaring array dimension and type at runtime
    K Karl 2000

    I am writing a program that requires array types and dimensions be decided at runtime. I can use System.Array.CreateInstance() to do this. What is the most efficient way to access the data in this array? I know I can use the getValue and setValue methods. I can also use the enumerable interface when allowed by the situation. Both of these are however inconvenient when compared to indexing the values using []. Does anyone have any suggestions. Efficiency of the code is a major consideration. Thanks, Karl

    C# question data-structures

  • process.start problem
    K Karl 2000

    Thanks for your help. I will attempt this to see if it has any impact. Karl Karl

    C# question sysadmin help

  • process.start problem
    K Karl 2000

    Thanks for your response. I am dealing with exceptions and none are getting thrown. It is also not a problem with the path. I can be sure of this because if you already have your reader open then the code will open the pdf file in your reader. Why would Process.Start behave differently when the reader is already open? This may not be a problem with my code, it may be a problem with the .NET framework, the windows API, or even Adobe's stuff. I am unable to find the cause. Thanks Karl

    C# question sysadmin help

  • process.start problem
    K Karl 2000

    Hi, I am using Process.Start("file.pdf") to launch the default pdf reader and open a file. This works the majority of the time. However during deployment I came across a few computers where this does not work. It does absolutely nothing. The reader is not launched and the file is not opened. However, on those computers if they manually launch their reader and then run the above code the file gets opened. Has anyone come across this problem before? Does anyone know what is happening? It is not a problem with the reader not being associated with the pdf file format. I know this because when they double click a pdf file from explorer it opens just fine. Thanks, Karl Karl Baum

    C# question sysadmin help

  • Question on events and local variables
    K Karl 2000

    The garbage collector will only collect when there reference count goes down to 0. By subscribing eventLog_EntryWritten to the EntryWritten event you are creating a reference. That reference is enough to keep the eventLog alive. Even though you no longer hold a reference one does exist. To get the garbage collector to collect the EventLog unsubscribe the event before eventLog goes out of scope and you no longer have control of any of the references to it. Karl Baum CEO of KGB Technologies Specializing in custom software development.

    C# question help

  • Setting application icon doesnt work
    K Karl 2000

    Hi, I am not sure if this is your problem or not. Icon files can have multiple versions of the icon, most commonly a (16x16 and 32x32) when the icon is being used the appropriate version is used. The default icon has both 16x16 and 32x32 versions, if you only changed one of them there will be some situation where the one you didn't change is used. To change the other version open the icon in the editor. Right click in the editing window (but not on the icon) and in the list that appears there will be "Current Icon Image Types". Hope this helps, Karl Karl Baum CEO of KGB Technologies Specializing in custom software development.

    C# csharp visual-studio winforms graphics question

  • A question about object sender
    K Karl 2000

    Hi, In your mouse down event handler sender is the object that caused the event. In this case it will be whatever picturebox the mouse went down over. I believe that by casting sender to a picturebox you will have the picturebox that the mouse went down on aka illustration[i]. Do this with ((PictureBox)sender).Capture = true; Karl

    C# question data-structures

  • How to use Raster/Bitmap Fonts ... ?
    K Karl 2000

    Hi, If you have a bitmap containing a bitmap font you can load that bitmap and when you want to write the letter 'a' you would draw that portion of the bitmap that has the 'a' on it. The portion draw is called a frame. Your bitmap would consist of a frame for each of the 26 letters and whatever punctuation you desire. In the article "Invasion - A computer game using DirectDraw" By Mauricio Ritter found at http://www.codeproject.com/directx/invasion.asp. This approach is taken. He does this using DirectDraw, but the same approach can be taken with GDI+. You can implement your own raster font as well, but that would be much more work. Karl Baum CEO of KGB Technologies Specializing in custom software development.

    C# csharp graphics json tutorial question

  • boolean expression evaluation
    K Karl 2000

    narada108, There is no class in .net to do what you would like. However, depending on the format of your Boolean expression this may not be a difficult task. This task can be broken down into two easier problems. Convert the expression to a postfix expression, and then evaluate the postfix expression. Typically a Boolean expression looks like this "1 and 1". This is called infix notation since the operator is between the operands. The postfix equivalent to this expression would be "1 1 and". In postfix notation the operator comes after the operands. A more complicated example follows: infix: "1 and 1 and not 0 or 0" postfix: "1 1 0 not and and 0 or" It looks difficult but you get used to it really fast. The main advantage of writing the expressions this way is that they are easy to evaluate. How to evaluate a postfix expression is covered in many introductory computer science classes. The following code will evaluate an expression in this format. private bool EvaluatePostfixExpression(string expression) { string[] pieces = expression.Split(new char[]{' '},100); System.Collections.Stack stack = new Stack(); foreach(string cur in pieces) { if (cur == "0") stack.Push(false); else if (cur == "1") stack.Push(true); else if (cur == "and") { bool second = (bool)stack.Pop(); bool first = (bool)stack.Pop(); stack.Push(first && second); } else if (cur == "or") { bool second = (bool)stack.Pop(); bool first = (bool)stack.Pop(); stack.Push(first || second); } else if (cur == "not") { stack.Push(!(bool)stack.Pop()); } } return (bool)stack.Pop(); } For example EvaluatePostfixExpression("1 1 0 not and and 0 or") will return true; I would recommend trying to get your Boolean expressions in postfix notation. If you can't then another simple stack based algorithm can be used to convert infix notation to postfix notation. I don't feel like writing that algorithm at the moment, so let me know if you go this way and need help with it. You can probably find these algorithms in a book on data structures. Karl Baum CEO of KGB Technologies Specializing in custom software development.

    C# csharp question

  • Catching key events to a panel?
    K Karl 2000

    The only thing I can think of is to have the form that the panel is on receive the keyboard events. Then it could call functions that cause your panel to do appropriate things. Karl Baum CEO of KGB Technologies Specializing in custom software development.

    C# question

  • Converting byte[] to Hex String;
    K Karl 2000

    Heath, I agree with Bo. Please do not waste our time with negative and counterproductive rants. Karl

    C# database data-structures help

  • Converting byte[] to Hex String;
    K Karl 2000

    Hi Bo, First off let me apologize for the rudeness of others. This is the place to post questions like these, and you did show us in the code exactly where the problem was occurring. I believe that replacing your troubled lines with the following might fix your problem. *ch3++ = *( ch2 + ( 1 * (( *b2 & 240 ) >> 4 ))); *ch3++ = *( ch2 + ( 1 * ( *b2 & 15 ))); b2++; Best of Luck! Karl Baum CEO of KGB Technologies Specializing in custom software development.

    C# database data-structures 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