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
T

therealmccoy

@therealmccoy
About
Posts
30
Topics
9
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • multithreading problem
    T therealmccoy

    When you refer to your main thread are you meaning that the GUI is unresponsive? If that's the case then you need to use BeginInvoke from your second thread that calls a method on your main thread that updates the GUI. I am not an expert, but I have implimented it serveral times. I still sometimes have to refer to previous code. Check CP for articles on updating your GUI. This is where I found my information. www.lovethosetrains.com

    C# help csharp mobile com question

  • COM interop and embedding
    T therealmccoy

    Thanks for the suggestion... Once I sober up and feel like working on real work again I'll give it a try.. I downloaded ILMerge at work, and breifly thought about working with it at home and then realized I don't get paid for it. I'm sure the best will get later this weekend... once again thanks.. reads like what I am looking for. :) www.lovethosetrains.com

    C# com csharp hardware question

  • COM interop and embedding
    T therealmccoy

    I have a project that uses a COM DLL. .NET created an interop assembly for me. I want to embed the DLL and the interop (Type Library ?) within my application so as to have a single file execution(the executable). Is this possible? I have tried adding the files as embedded resources, but still get a file not found exception when I run the application. Thanks www.lovethosetrains.com

    C# com csharp hardware question

  • Class/Application design question
    T therealmccoy

    Background: I need to read in 3 text files. Each file has it's own format. I decided to code a class for each type. Each class impliments some common methods: getItem() getDescription(item) getCount() In addition each class contains some items that are more specific to the data in that file. I originally had specified the name of the file to be read in the constructor. The constructor would then load the file (and it's associated data) into arrays then close the file. The instance would look like this... fileReader1 fr1 = new fileReader1(sFileName); It was then requested that I validate my input files. This is where my question lies.. What is the best approach for this functionality? Bear in mind I need to not process anything if the file is not valid. I am currently working on a 3 tier design (GUI, Logic, Data). The readers are called from the Logic layer. I have mulled the following: #1 Move the ability to read the file from the constructor to a public method. Code a new method called 'validated()' that would return TRUE if the file was valid and then call the read method (this would be done from the Logic layer) if validated returns TRUE #2 Continute to read in the file via the constructor, but only read the file if it is valid (via private validate method). If the file is not valid fire a 'not valid event' and catch it in my GUI. #3 Create a seperate class called 'Validator' that I pass in the file to validate and the type. If this returns TRUE then continue, otherwise dont' #4 Let the constructor validate the file. Set a bool variable in my reader class and expose it as a public property. If file is valid set variable to TRUE and call public read method. I am interested in the best way, the 'professional' way to impliment this. Thanks in advance for your thoughts/comments. www.lovethosetrains.com

    C# question com design discussion

  • How to update ComboBox/ListBox bound to ArrayList?
    T therealmccoy

    Nope.. Doesn't do the trick. The Refresh method just forces the control to redraw (not update what it knows).. I was thinking of adding an event that fires when the ArrayList is changed and entending the control (ListBox/ComboBox) to have a new method that updates the bindings. I'm just not wanting to overly complicate it (or do more work then needed). Thanks. www.lovethosetrains.com

    C# com help tutorial question announcement

  • How to update ComboBox/ListBox bound to ArrayList?
    T therealmccoy

    I have a ComboBox that has the DataSource property set to an ArrayList. I am using the following code to force the ComboBox to update when I make changes to the ArrayList: this.cboTrains.DataSource = null; this.cboTrains.DataSource = alTrains; this.cboTrains.DisplayMember = "Name"; Is there a better way? Also have the same issue with ListBox. Thanks. www.lovethosetrains.com

    C# com help tutorial question announcement

  • combobox.DataSource VS DataGrid.DataSource
    T therealmccoy

    Dunno about .Net 1.1, but I just ran across this issue as well. I used the DisplayMember property (in conjunction with DataSource) to properly display the value in a ComboBox/ListBox control. Otherwise I just saw the name of the object. www.lovethosetrains.com

    C# help csharp visual-studio question

  • System.Diagnostic.Process question/problem
    T therealmccoy

    Just glad that I can actually be of help. www.lovethosetrains.com

    C# help question linux

  • System.Diagnostic.Process question/problem
    T therealmccoy

    I used: p.CreateNoWindow = true; www.lovethosetrains.com

    C# help question linux

  • Custom Controls and events
    T therealmccoy

    I'm not a dot net guru, but I had a similar issue and will share. I created a control that creates a SQL statement based upon user selections. I needed an event that would fire when the SQL was generated. I first declared the following: public delegate void SQLCreatedHandler(); [Category("Action")] [Description("Fires when the SQL is created")] public event SQLCreatedHandler SQLCreated; When I wanted to fire the event I called this code: //Raise event notifying subscribers that the SQL has been created OnSQLCreated(); And the OnSQLCreated() method looked like this: // If an event has no subscribers registerd, it will // evaluate to null. The test checks that the value is not // null, ensuring that there are subsribers before // calling the event itself. if (SQLCreated != null) { SQLCreated(); // Notify Subscribers } From the hosting application I created a handler for the event: this.queryControl1.SQLCreated += new QueryControl.QueryControl.SQLCreatedHandler(this.queryControl1_SQLCreated); And the method for the handler: private void queryControl1_SQLCreated() { MessageBox.Show(this.queryControl1.SQL); } Hope this helps, don't mind the codeing. I found the articles here on CP that helped me create the above code. Search the articles, not messageboards www.lovethosetrains.com

    C# help

  • about get connection string from app.config
    T therealmccoy

    Ok I'll byte again... by chance are u creating a new instance of your DAL in BLL and then not reading the app.config? If the variable holding your connection string is not static then it would be null when you created a new instance of DAL. You could try declaring your connection string variable in DAL as static (might not be good practice) and see what you get. I was thinking maybe your method only returns a (GET) value and does not actually go out and read the app.config. :+) www.lovethosetrains.com -- modified at 22:20 Wednesday 28th September, 2005

    C# help

  • about get connection string from app.config
    T therealmccoy

    just a WAG... You might want to try including an \ before each of the quotes in your connection string. There also seems to be a missing quote after Server Name =" If the value needs to be null I would try: Server Name =\"\" Provider might also need to use \" instead of ' but alas it's just a WAG and I'm sure someone else will point me (or you) the right way Let me know if it works. www.lovethosetrains.com

    C# help

  • More Efficient Code
    T therealmccoy

    If all of your checkboxes are located in a container control (panel, groupbox) or if they are the only controls on your form then you could use a foreach statement. foreach(Control aControl in form1.controls) { CheckBox aCheckBox = (CheckBox) aControl; aCheckBox.Enabled = true; } I did not test the above code. It's just off the top of my head. You could also create and arraylist of checkboxes and interate through then the same way. www.lovethosetrains.com -- modified at 13:10 Thursday 22nd September, 2005

    C# c++ tutorial question

  • WaitForExit
    T therealmccoy

    Use threading to start notepad on a new thread. www.lovethosetrains.com

    C# help question

  • Loading multiple image files
    T therealmccoy

    You can load your pictures into an array of type Image or BitMap and then assign the element of the array that contains the picture you want to display to the image property of the PictureBox. Loading the pictures into an array allows you to quickly change the picutures (without have to load each one from a file, all done when you load them into the array) I think you could also use an ImageList (control), but I'm guessing and have not had much luck with it's implimentation. Last time I used it I have a problem with my pictures being reformatted and never looked into it. www.lovethosetrains.com

    C# question

  • Recursive method calling (is it wrong?)
    T therealmccoy

    Thanks for the input. Was working a 'C' port and the other programmer was surprised that I could call my function from within my function. I will relook at the code and probably impliment your suggestions. Thanks again. www.lovethosetrains.com

    C# com question

  • Recursive method calling (is it wrong?)
    T therealmccoy

    I have a search method that calls it's self until a condition is true. Is this wrong? private void TriggerSearch() { *** other misc code *** if(!blnTriggerFileWritten) { TriggerSearch(); } } Thanks. www.lovethosetrains.com

    C# com question

  • How to call default text editor
    T therealmccoy

    Thanks all for you help. I used the Process.Start and passed in my textfile. I didn't use a RichTextBox because I didn't need/want to code the addtional functionality to print/preview etc. This application is also written as a DLL so that later it can be incorporated as a webservice. In addition where I work people have changed the application associated with *.txt to an editor that they prefer. Thanks again. I didn't realize that I could use Process.Start and just pass in a filename and let Windows handle the rest. www.lovethosetrains.com

    C# com tutorial question

  • Program with no UI
    T therealmccoy

    I would start with a Class Library. www.lovethosetrains.com

    C# winforms design help question

  • How to call default text editor
    T therealmccoy

    I created an application that creates a text file as output. After the file is created I would like to give the user the option of opening the file using their default text editor (usually notepad.exe, but not always). How can I find out and use the Windows default text editor (the one associated with *.txt files) Thanks. www.lovethosetrains.com

    C# com tutorial 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