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
B

Brian Nottingham

@Brian Nottingham
About
Posts
23
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Little Help pls
    B Brian Nottingham

    Shouldn't that tag be

    ? Sometimes it helps when you pass valid XML to the LoadXML function : ).

    C# help xml tutorial question

  • constant WM_PAINT messages
    B Brian Nottingham

    WM_PAINT methods are handled differently than other messages by Windows. A WM_PAINT message is automatically sent if there are any outstanding invalid regions in your window. Windows knows that have painted your window, and thus stop sending WM_PAINT, after an application calls the Win32 functions BeginPaint\EndPaint. The easiest way to accomplish this in your case is by calling the base class OnPaint, which handles it for you.

    C# graphics debugging question

  • Hashtable Item
    B Brian Nottingham

    In C# the "Item" property is accessed using indexer syntax. So instead you would write something like this. Hashtable myHash = new Hashtable(); object value = myHash[key];

    C# help

  • Error: usbtest(Cs).exe----cannt find DLL
    B Brian Nottingham

    Yes, your customers would have to install the .NET Framework before using any application developed in a .NET language. The .NET Framework is not required for C++\MFC, but it is however required if you use MC++.

    C# help csharp tutorial question

  • Error: usbtest(Cs).exe----cannt find DLL
    B Brian Nottingham

    Right, thats what I am saying. If you have VS.NET installed on your computer, then you have the .NET Framework installed, and thus your program works. If the other PC's do not have VS.NET installed, or the .NET Framework installed, then your program would not work.

    C# help csharp tutorial question

  • Error: usbtest(Cs).exe----cannt find DLL
    B Brian Nottingham

    Hello, The .NET application must be installed to run a .NET application. mscoree.dll is a DLL that is installed as a part of the .NET framework installation. You cannot redistribute this DLL yourself, it must be installed with the .NET framework installer.

    C# help csharp tutorial question

  • Checking If Form Is Loaded
    B Brian Nottingham

    One way would be to hook an event handler to Application.Idle in the handler you have for Form.Load. The Idle event will be raised right after the Form is actually visible to the user. Remember to unhook your handler for Application.Idle in your handler for it. You could also use BeginInvoke, which basically uses WM_POST to acheive a delayed call. So at the end of your Form.Load handler, you could do something like "BeginInvoke(new EventHandler(MyFunction));"

    C# question graphics announcement

  • SQL server Timeout
    B Brian Nottingham

    Heath Stewart wrote: an application should never let a user enter an arbitrary query Totally agree. Heath Stewart wrote: select too many records for the intended use of the data I guess thats what i was getting at, but with the added twist that the user was allowed to enter it. The programmer should have an idea of the data the database may contain, and write the queries appropriately. If you know its going to take a while, increase the timeout. Which is what you already said a few posts ago, so... yeah... Brian

    C# database sql-server csharp sysadmin help

  • SQL server Timeout
    B Brian Nottingham

    Heath Stewart wrote: invalid commands can make your program take needlessly longer to return in err Heath - what do you mean by "invalid command"? The call to the DB should return as soon as the DB is done processing it, regardless of the timeout right? So if the command is invalid, wouldn't the DB return some type of syntax error immediately? Well, now that I think about it, if the application allowed the user to enter an arbitrary query, I guess the user could do something silly that took forever to execute which would effectively hang the app until the timeout was reached. Is this the type of situation you are referring to? Brian

    C# database sql-server csharp sysadmin help

  • Timers - Click-number dependent triggering
    B Brian Nottingham

    I think the modulus operator would work well for you in this situation. Without going into the details, if you have: int result = someValue % 4; Then result will be zero if and only if someValue is divisible by 4. I think you can use this information to build a solution to your problem.

    C# csharp question

  • Singleton
    B Brian Nottingham

    If there is no explicit need for an object instance, I find the use of all static members simpler. If you want to use it to persist data using the framework's builtin serialization, then you would need an object.

    C# regex help question

  • best regex mail pattern ?
    B Brian Nottingham

    I agree with you, that hard-coding those vales could make it hard to maintain and update the application. Depending on the intended use, there are always tradeoffs. Read from a config file, hard-code them, use your ([a-z]{1,}) method, and probably a few others. The goal of my original post was to give a good starting point for an email regex, and I considered the example from Jeffrey Friedl's book to be pretty good. Thank you for pointing out ways in which it could be improved in practice.

    C# regex csharp algorithms question

  • best regex mail pattern ?
    B Brian Nottingham

    Following that logic, you wouldn't need a Regex at all. Just try to send the email, using any random string as the address, and "let DNS do its job". ([a-z]{1,}) validates lots of invalid email addresses. The last time I checked, only the TLD's, plus 2 letter combinations were valid. Its best to spell this out explicitly in the regex.

    C# regex csharp algorithms question

  • best regex mail pattern ?
    B Brian Nottingham

    private Regex emailReg = new Regex( @"(?\w[-.\w]*)@(?[-a-z0-9]+(\.[-a-z0-9]+)*\." + @"(com|edu|gov|int|mil|net|org|biz|info|name|museum|coop|aero|[a-z][a-z]))", RegexOptions.IgnoreCase); Credit goes to http://www.bookpool.com/.x/ocstn6vf4n/sm/0596002890[^]

    C# regex csharp algorithms question

  • One application with multiple forms
    B Brian Nottingham

    What does the function "InputSelection" do? In a simple test application, this works fine for me: static void Main() { Form1 form1 = new Form1(); form1.ShowDialog(); Application.Run(new Form2()); }

    C# design sysadmin question

  • One application with multiple forms
    B Brian Nottingham

    Please look at the code I had posted. For the "UserInterface" class, do not use ShowDialog(), but rather Application.Run(ui).

    C# design sysadmin question

  • One application with multiple forms
    B Brian Nottingham

    You are not doing anything wrong, this is a bug in the framework. When Application.Run finishes, a bit is set indicating that the message pump on the thread has shutdown. This bit is sticky, and any subsequent calls to Application.Run see this bit set and immediately terminate. However, this should workaround your problem: static void Main() { ServerOrClientForm serverOrClient = new ServerOrClientForm(); Application.Run(serverOrClient); serverOrClient.ShowDialog(); serverOrClient.InputSelection(); UserInterface ui = new UserInterface(); Application.Run(ui); // pass information to and from ui obj = ui.GetInfo(); // ... ui.SetInfo(obj); }

    C# design sysadmin question

  • ToolBar That Doesn't Move
    B Brian Nottingham

    You could put a panel inside the form that would be your effective client area. The panel would be set to allow scrolling, but not the form. The panel would leave enough room for the OK\Cancel buttons, which would be on the form, not the panel. Brian

    C# question

  • How do i get the location of a control in screen coordinates?
    B Brian Nottingham

    Something like this maybe... Point screenPt = control.Parent.PointToScreen(control.Location);

    C# question tutorial

  • DataGrid Turning Off Row Headers
    B Brian Nottingham

    If you have used custom table and column styles, then you need to turn that property off on the DataGridTableStyle object.

    C# winforms question
  • Login

  • Don't have an account? Register

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