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

Keith Malwitz

@Keith Malwitz
About
Posts
56
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Attached Properties [modified]
    K Keith Malwitz

    For an Attached Property (as opposed to a regular Dependency Property), you will want to implement the Accessors as methods, not a property.

    public static void SetTextContent(UIElement element, Object value)
    {
    element.SetValue(TextContentProperty, value);
    }
    public static Object GetTextContent(UIElement element)
    {
    return (Object)element.GetValue(TextContentProperty);
    }

    As to whether or not you should be using an Attached Property, this link should help you answer that question: http://msdn.microsoft.com/en-us/library/ms749011.aspx[^] Hope this helps, Keith EDIT: You may also want to look at Setting Appropriate Metadata Flags section at http://msdn.microsoft.com/en-us/library/ms753358.aspx[^] in regard to how the control should handle updates to this property.

    modified on Monday, July 20, 2009 12:19 PM

    WCF and WF wpf question

  • Exposing Many-To-Many Relationship as Listbox with Checkboxes
    K Keith Malwitz

    I am trying to expose a many to many relationship in my GUI using a listbox. My DataModel consists of Linq To SQL generated classes, so I have three objects to deal with; one for each side of the many to many and one for the intersection table. My listbox's itemssource is bound to one side of the relationship (so that I show ALL items in that table). My listbox items are using a datatemplate containing a checkbox and a textblock. The textblock is bound to the name of the property. How can I bind the checkbox's IsChecked property so that items that exist in the intersection table cause it to be checked?

    WCF and WF question csharp database linq

  • Barcode scanning for a POS
    K Keith Malwitz

    It shouldn't take much code to scan a barcode. Today's barcode scanners do all the processing of the barcode and are simply an input device no different than a keyboard. If you have your scanner hooked up, move focus to a text box on your form and scan a barcode. The textual representation of that barcode should appear in the textbox. Hope this helps.

    Visual Basic question

  • regex name/value pairs
    K Keith Malwitz

    Try replacing the \w+?\k with: .+\k This will match everything between the quotes. The \w is matching any word character, so it's not matching the spaces. The period will match anything, and since we want to get everything between the quotes, we use the + to denote one or more matches. Hope that helps.

    .NET (Core and Framework) regex help question

  • regex name/value pairs
    K Keith Malwitz

    You will need to test for quotes and assign the substring a name. Do this at the first place in your expression where the quotes can occur. This will test for optional single or double quotes: (?[""']?) -- *The double-quote is repeated as shown if it exists in a VB string. You must then use conditional matching to test whether has been assigned. The syntax for the conditional match is: (?yes|no) -- The |no portion is optional. So, (?\k) Will test whether was previously assigned, and if so it will match it again. Otherwise, it does nothing. Hope that helps.

    .NET (Core and Framework) regex help question

  • Object & Form Control Binding
    K Keith Malwitz

    http://msdn2.microsoft.com/en-us/library/system.windows.forms.controlbindingscollection(VS.71).aspx[^]

    Visual Basic csharp visual-studio wpf wcf question

  • How to connect the POstgreSQL 8.1.4 with Borland Developer Studio 2006 (Delphi.NET)
    K Keith Malwitz

    http://www.connectionstrings.com/?carrier=postgresql[^]

    Database csharp delphi database asp-net postgresql

  • how to load the previously hidden form in C#
    K Keith Malwitz

    CurrentFormName.Hide PreviousFormName.Show Obviously that's VB code, but you should be able to figure out the C# equivalent pretty easily.

    .NET (Core and Framework) help csharp tutorial

  • problem getting sum of each row
    K Keith Malwitz

    Any expression containing a null value will evaluate to null. There are a couple of ways around this. You could define your database columns so that they are not allowed to contain null values, and assign them a default value of zero. Another method would be to test each value for null, and use 0 for the value of that operand if the result is true. Hope that helps.

    Database question help

  • Sharing data across threads
    K Keith Malwitz

    The potential problem on a hyperthreaded or multi-processor PC is due to the fact that each processor in a PC maintains its own cache. Therefore, if any of the threads executing in your routine happen to run on a different processor, that processor updates its own cache and does not automatically publish the new value to the other processor. This would cause your counter to 'miss' that particular iteration of the counter. There are several potential solutions to get around this, for instance using the VolatileRead and VolatileWrite methods of the Thread class (these use shared memory that all processor's can access, rather than storing the value of your variable in a CPU register) or using the MemoryBarrier of the Thread class (this method flushes the caches and CPU registers of all the processors into memory, ensuring that variables contain current data). You can get plenty of info on the Thread class and it's methods on the MSDN website. Hope that helps.

    .NET (Core and Framework) css com learning

  • Cloning an object
    K Keith Malwitz

    The previous poster is dead-on. You will need to write a function in your class that implements the ICloneable.Clone. For example: Public Class MyClass Public Function Clone() as Object Implements ICloneable.Clone Return Me.MemberwiseClone() End Function End Class You can then call the Clone function from outside the class to create a shallow copy of your type.

    Visual Basic csharp tutorial question

  • Cloning an object
    K Keith Malwitz

    http://msdn2.microsoft.com/en-us/library/system.object.memberwiseclone.aspx[^]

    Visual Basic csharp tutorial question

  • Determining Memory Footprint of a filled Dataset
    K Keith Malwitz

    I am curious as to what would be the best method to determine the memory allocation footprint of a filled dataset object. Can anyone point me in the right direction?

    .NET (Core and Framework) performance question

  • ListView Question
    K Keith Malwitz

    I am having a problem with the VB 2005 ListView control using the Details view. I am basically using the ListView to display information from a database table. The problem I am having is that one of the columns is concatenating the string that is being passed to it for one of the subitems, and not showing all of the text. My questions would be, 1) Is there a property that I am not seeing that will keep the text from being cut short, and 2) Does the ListView support a multi-lined item that can wrap?

    Visual Basic question database help

  • BindingSource position after table.AddRow(..)
    K Keith Malwitz

    I am not a CS programmer, but it sounds like you may need to call the ResetBindings method on your BindingSource control(s) prior to calling MoveLast. Hope this helps.

    .NET (Core and Framework) csharp css visual-studio help question

  • DATE query
    K Keith Malwitz

    The where clause will be something along the lines of: WHERE OccDate BETWEEN StartDate AND EndDate But it is impossible to give you the exact syntax without knowing what database you are using.

    Database database question

  • Typed dataset with cascade delete using TableAdapter
    K Keith Malwitz

    Perhaps I was not clear enough in my previous post. When updating a data source containing multiple related tables, you should update in this order: 1. ChildTable Deleted Records 2. New, Modified, and Deleted ParentTable Records 3. New ChildTable Records 4. Modified ChildTable Records This order ensures that updates can be performed properly, taking into account the relationship between the tables. The link in my previous post will walk you through how to update records based on their status (Added, Modified, Deleted). Hope this helps.

    Database csharp css database help tutorial

  • Dataset VS Datagrid
    K Keith Malwitz

    You still need to bind the datagridview to the data you wish to display. Check out these articles: http://msdn2.microsoft.com/en-US/library/071hftc7.aspx[^] http://msdn2.microsoft.com/en-US/library/wwh8ka92.aspx[^] Hope this helps.

    Database database visual-studio xml help question

  • New to VB...looking for some help...
    K Keith Malwitz

    http://msdn2.microsoft.com/en-US/library/cf131f6b.aspx[^] http://msdn2.microsoft.com/en-US/library/ms171893.aspx[^] http://msdn2.microsoft.com/en-US/library/ms172560.aspx[^] Hope this helps get you started.

    Visual Basic database csharp css help

  • Deleting columns from DataTable
    K Keith Malwitz

    DataTable.Columns.Remove("ColumnName") or DataTable.Columns.Remove(ColumnIndex) or DataTable.Columns.RemoveAt(ColumnIndex)

    Database csharp
  • Login

  • Don't have an account? Register

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