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
M

MarkB123

@MarkB123
About
Posts
51
Topics
17
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • The Ipcress File
    M MarkB123

    Desmond Bagley - one of my favourite authors - Running blind is a great book - all his original books are great - haven't yet read the recently discovered lost book - Domino Island yet though...

    The Lounge question discussion

  • Would this pass code review where you are?
    M MarkB123

    The first and most important question - does it work? The second question, how long ago was it written and what were the time-constraints and pressures of the project? It's easy to stand there and criticize other peoples work. Pretty sure no matter what you produce code-wise there will be better ways to do it either now or in the future. I never understand why people feel the need to post things like this - I'd guess some underlying insecurity issues...

    The Lounge csharp com question discussion code-review

  • Winforms Inherited form - Resources
    M MarkB123

    I think that is the likely cause since the base form is in a different assembly. It would make sense that VS is trying to make sure the image is still available to the child forms in a different assembly by copying the resource into the resx file. I'll try moving the base form into the same assembly to see if it resolves the issue. Thanks.

    C# csharp winforms regex oop question

  • Winforms Inherited form - Resources
    M MarkB123

    Good idea unfortunately, it gets weirder by the minute. If I apply my fix then open the designer and make any change at all to the design surface of the screen and save it, it puts the code back I deleted and re-adds the images back into the resource file!

    C# csharp winforms regex oop question

  • Winforms Inherited form - Resources
    M MarkB123

    Running across multiple assemblies. I think I may have got to the bottom it. I created a brand new inherited form from the base form and it behaved correctly. On comparing the designer.cs code of the new form with one of my original (problematic) inherited forms, it looks like a load of extra code has been inserted into the code behind the designers. For Example: // // bsiAdd // this.bsiAdd.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("bsiAdd.ImageOptions.Image"))); This seems to have also pushed the images into the resx file. If I remove all the bits of code for about 50 menu items then remove the images manually from the resx file then the inheritance seems to work properly. The only thing I can think of which might have caused this is I put a DevExpress SharedImageCollection onto my main window form and I'm thinking that the nature of this control has perhaps caused this. Issue I have now is I have to apply my manual fix to several hundred forms!

    C# csharp winforms regex oop question

  • Winforms Inherited form - Resources
    M MarkB123

    Thanks for the response. I don't know. On my simple test it also worked. But on my application that hundred of forms and a quite complex set of base forms it doesn't work. Really at a loss.

    C# csharp winforms regex oop question

  • Winforms Inherited form - Resources
    M MarkB123

    It's really strange - when I create a really simple project with just 2 forms - a parent and inherited child, it behaves correctly.

    C# csharp winforms regex oop question

  • Winforms Inherited form - Resources
    M MarkB123

    I've tried both.

    C# csharp winforms regex oop question

  • Winforms Inherited form - Resources
    M MarkB123

    Got an odd one I could do with some advice on... I have a base form all my decendent data entry forms are based on. The base form had some menus defined on it with icons on the various menu options. This means all the child data entry forms have them too. So far so good. I decided to update the icons on the base form, thinking this change would automatically cascade down to all the child forms but no, they don't. When I open the resources file for each child form, they have a separate copy of the icons. Why would this be - surely it defeats the whole point of visual inheritance? Any suggestions on how I can update all the icons on the child forms to match? I can't go through them one by one and manually adjust as I have several hundred forms in the application. Many thanks.

    C# csharp winforms regex oop question

  • How do I use this class
    M MarkB123

    Many thanks for the link - It doesn't quite go far enough for me though as I also need access to the hours and seconds (which the class I posted gives me - [I need to test it though]). :)

    C# question help

  • How do I use this class
    M MarkB123

    Thanks for replying. I realize there is a TimeSpan but it's no use to me as it doesn't show Weeks or Years elapsed and I need them. Your example worked (many thanks) - I hadn't noticed that the method was static...

    C# question help

  • How do I use this class
    M MarkB123

    I found this class on a forum... How do I use it - I can't seem to callthe Difference method in bold text? I'm currently trying... DateDiff dateDiff = new DateDiff(); dateDiff.Difference((DateTime)StartDate, (DateTime)EndDate); // Doesn't Work Many thanks for any help. public class DateDiff { private int _Years = 0; private int _Months = 0; private int _Weeks = 0; private int _Days = 0; private int _Hours = 0; private int _Minutes = 0; private int _Seconds = 0; public int Years { get { return _Years; } } public int Months { get { return _Months; } } public int Weeks { get { return _Weeks; } } public int Days { get { return _Days; } } public int Hours { get { return _Hours; } } public int Minutes { get { return _Minutes; } } public int Seconds { get { return _Seconds; } } public override string ToString() { return String.Format("{0} year{1}, {2} month{3}, {4} week{5}, {6} day{7}, {8} hour{9}, {10} minute{11}, {12} second{13}" , Years, Years != 1 ? "s" : "" , Months, Months != 1 ? "s" : "" , Weeks, Weeks != 1 ? "s" : "" , Days, Days != 1 ? "s" : "" , Hours, Hours != 1 ? "s" : "" , Minutes, Minutes != 1 ? "s" : "" , Seconds, Seconds != 1 ? "s" : "" ); } static public DateDiff Difference(DateTime dt1, DateTime dt2) { if (dt1 > dt2) { DateTime dtTemp = dt1; dt1 = dt2; dt2 = dtTemp; } DateDiff dd = new DateDiff(); dd._Years = dt2.Year - dt1.Year; if (dd._Years > 0) { if (dt2.Month < dt1.Month) { dd._Years--; } else if (dt2.Month == dt1.Month) { if (dt2.Day < dt1.Day) { dd._Years--; } else if (dt2.Day == dt1.Day) { if (dt2.Hour < dt1.Hour) { dd._Years--; } else if (dt2.Hour == dt1.Hour) { if (dt2.Minute < dt1.Minute) { dd._Years--; } else if (dt2.Minute == dt1.Minute)

    C# question help

  • Hosting a small dot net app and SQL Server Express db
    M MarkB123

    Hi All, As per the title of this post... I have developed a small Dot Net WinForms C# application which uses a SQL Server Express 2008 as the database to link to which I would like to sell. What I'd like to do is use some remote hosting service so I can put up the app and DB and give customers a trial of it before they commit to paying for it at which point I can roll it out to their own network or leave them with the hosted service if they don't have their own network. As I've never deployed an app to a cloud based host, can some kind person give me some recommended cloud hosts who won't charge too much monthly and where I can load my Winforms App (dot Net 4.5) and I can install SQLServer Express 2008? Basically the host will need to support dot net framework 4.5 (or I have the option to put it on myself ) and SQL Server Express 2008 (or I have the option to put it on myself). The end-user would ideally access the app via a VM. I've had a look at RackSpace but I'm unsure of which of their options I would need... Many, many thanks. :)

    .NET (Core and Framework) database csharp sysadmin hosting sql-server

  • Dll References and Dependencies
    M MarkB123

    Thanks BobJanova, this might be all I need.

    C# csharp winforms help question

  • Dll References and Dependencies
    M MarkB123

    Richard, many thanks for taking the time to reply. I'll check out the links you kindly posted.

    C# csharp winforms help question

  • Dll References and Dependencies
    M MarkB123

    Hi, I have the following issue with my WinForms C# project and wonder if someone could point me to a solution... I have a reference to a 3rd party DLL (which I am charged for and is licensed on a per end-user basis). The dll allows me to run certain functionality within my project. Ideally I'd like to to check if the Licence file \ DLL exists (I can do this) then if it exists, proceed as normal, but if it doesn't exists, then remove access to the functionality the Dll provides. The issue I have is that I have references in the project to the DLL, so if the licence file is not there or the DLL file is not present, the app explodes on startup. Is there any way I can get around this issue? Many thanks.

    C# csharp winforms help question

  • Parsing an XML File
    M MarkB123

    Thanks again Richard.

    C# csharp linq xml json help

  • Parsing an XML File
    M MarkB123

    Richard, Firstly, thanks for taking the time to respond. You answer was exactly what I needed - many thanks for this. One quick question... Is it possible to add some sort of where clause into it so that only those rows with a TASK_TYPE = "2" are returned? Sorry, I'm new to parsing XML... :)

    C# csharp linq xml json help

  • Parsing an XML File
    M MarkB123

    Hi, Can someone help me parse the following XML with DotNet C# 4.0? I'm trying to do it with linq. XML is as follows... 0 "Success" "(Job 1) No Errors detected" 0 "Success" "(Job 2) Scheduling Complete. All available orders were planned." "" "A24" "" "" "" "" "XXX" "Run-0001" 1 4 0 0.00000 0.00000 "" "" "" "" "" 0.00 0.00 "XXX" "00:00:00" "00:00:00" "00:00:00" "00:00:00" 0 0 0 0 0 "Mon" "19:00:00" "Mon" "19:00:00" 0 0 0.000 0.0000 2 "" "A24" "A24" 61.000 102 102 "PDA3" "761" "YYY" "111" "222" "0.00" "0.00" "XXX" "Run-0001" 2 2 2 0.00000 0.00000 "" "" "" "" <

    C# csharp linq xml json help

  • Converting a date format
    M MarkB123

    Thanks for the reply. I can't get it to work as a UTC. If I change it to UTC+ by adding the plus sign in to replace the space directly after the UTC on the fly then parse I can get it to work... string strStart = "Mon Sep 9 00:00:00 UTC 0100 2013"; strStart = strStart.Replace("UTC ", "UTC+"); DateTime dtStart = DateTime.ParseExact(strStart, "ddd MMM d HH:mm:ss UTCzzzz yyyy", CultureInfo.InvariantCulture); This works!

    C# question 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