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
C

c0ax_lx

@c0ax_lx
About
Posts
46
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Save/Load Class
    C c0ax_lx

    Congratulations on getting your code to work :) This approach isnt very dynamic tho and if you add or remove fields you would have to modify your save/load methods. I suggest that you read some articles about Serialization. Start with XML serialization, that way you can open the xml file in your browser and see everything. binary serialization isnt very fun to look at :].

    A FOO walked into a BAR, and the horse said..

    C# question csharp linq graphics

  • Cryatal report error
    C c0ax_lx

    {"Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))"} 3. crParameterFieldDefinition = crParameterFieldDefinitions["recpt"]; Maybe there is no parameter named "recpt" ?

    If it' stuck, DO NOT pull harder!

    C# help database

  • Retrieve the control's name
    C c0ax_lx

    ok! Thanks Luc, for a split second i thought you were wrong, i should have known better ;)

    If it' stuck, DO NOT pull harder!

    C# tutorial question

  • Retrieve the control's name
    C c0ax_lx

    According to MSDN help -GetType and typeof returns System.Type, i totally agree with "if (sender is TextBox)". A humble question, do you mean that GetType()==typeof compiles as a string comparizon? else i dont understand the "do NOT compare strings to check for a type, instead use the appropriate keywords"

    If it' stuck, DO NOT pull harder!

    C# tutorial question

  • Retrieve the control's name
    C c0ax_lx

    Hi. void ctrl_Click(object sender, EventArgs e) { if (sender.GetType() == typeof(TextBox)) { string name = ((TextBox)sender).Name; } } should work. Also if you are only interested in handling clicks for textboxes you could change the foreach loop to: foreach (Control ctrl in Controls) { if (ctrl.GetType() == typeof(TextBox)) { ctrl.Click += new EventHandler(ctrl_Click); } }

    If it' stuck, DO NOT pull harder!

    C# tutorial question

  • Automatic download attachment from emails
    C c0ax_lx

    Here's A POP3 Client in C# .NET[^] a good link to get you started on the emails. look at the last codeblock for attachment retrieval.

    If it' stuck, DO NOT pull harder!

    C# csharp database

  • ToString() method on objects returned from a webservice (Compact framework) [modified]
    C c0ax_lx

    I tried changing StringType to int. did nothing. This confuses me a little. The properties of the object can be modified and keeps their state on the client. but all changes are lost on the server. since it is stateless one would think that the "original" values also would be lost, and why isnt the client object values passed to the server for method invocation. thank god for Apress Books and vacation coming up :) Anyway, i solved this by having a local class with the same properties and my custom ToString.

    If it' stuck, DO NOT pull harder!

    C# help question debugging tutorial

  • ToString() method on objects returned from a webservice (Compact framework) [modified]
    C c0ax_lx

    Edited, Thanks for noticing! allthough this was just an example and not the actual code, else the post would have been very very long

    If it' stuck, DO NOT pull harder!

    C# help question debugging tutorial

  • Quick quest
    C c0ax_lx

    Ok. i cant say i really understand your question, but rxMessage[2] is the 3'rd byte if that's what you're asking. MCU's are cool btw. i use AVR's alot :)

    If it' stuck, DO NOT pull harder!

    C# announcement

  • Quick quest
    C c0ax_lx

    switch (rxMessage[2]) <- change to rxMessage[1] since arrays starts at 0. rgds Tomas

    If it' stuck, DO NOT pull harder!

    C# announcement

  • ToString() method on objects returned from a webservice (Compact framework) [modified]
    C c0ax_lx

    Hi. I'm having a problem and cannot find the solution. trust me, i've read lots on msdn and google'd, in the wrong places obviously but i hope someone here can help me. I'm porting an application to compact framework 3 and to reduce client side load i created a webservice for the BL (also, else i would have to copy all code and compile to CF since i cant use "regular" dll's in CF) this webservice exposes some custom classes and a couple of methods. a simple example would be (in webservice) public enum ToStringType { FirstName, LastName } public class person { public string firstname {get;set;} public string lastname {get;set;} public ToStringType stringtype {get;set;} public person(){ stringtype = ToStringType.FirstName ; } public override ToString(){ public override string ToString() { string tostr = string.Empty; switch (stringtype ) { case ToStringType.FirstName : tostr = FirstName; break; case ToStringType.LastName: tostr = LastName; break; } return tostr; } and the ws has a method returning person[] on the client. when i run the method and get a list of persons first of all: myperson.ToString() returns the object class name. not first/last-name so i add a method: tostr (){ ... } with the logic in tostring(), this works. returns firstname. but if i (on the client) myperson.stringtype =ToStringType.LastName; and debug the application, i see that myperson.stringtype IS ToStringType.LastName but the method returns firstname. i would really get the tostring to work since i'm adding the person[] to a combobox and i prefer not to use datasource/bindings. (tried those to. same problem, Displaymember has no effect) how come this split personality disorder in my classes, and why does ToString return the class name instead of my overloaded ToString method? I hope someone can help me regards Tomas

    There is no spoon

    modified on Tuesday, June 30, 2009 10:54 AM

    C# help question debugging tutorial

  • Convert String to set it on richBox
    C c0ax_lx

    Does your code look like this: public Form1() { MailMessage2.Text = "eeeeeeee"; InitializeComponent(); }? change it to public Form1() { InitializeComponent(); MailMessage2.Text = "eeeeeeee"; }

    If it' stuck, DO NOT pull harder!

    C#

  • How to export a bitmap from a crystal report?
    C c0ax_lx

    D'uh! i'm really sorry! this wasnt even my post! not used to see crystal report questions here *sigh*. well. You are totally correct, your post is the answer to the question. so i'll just shut up now and try to find my own post. hmm. i feel stupid. Rgds Tomas

    If it' stuck, DO NOT pull harder!

    C# csharp graphics tutorial question

  • How to export a bitmap from a crystal report?
    C c0ax_lx

    Hi thanks for the reply. but.. the link takes me to a page describing how to "export crystal as image" perhaps you gave me wrong link? or else my english writing is a total failure. i need help on how to list parameter values dynamically created by the report. Br Tomas

    If it' stuck, DO NOT pull harder!

    C# csharp graphics tutorial question

  • "Windows has triggered a breakpoint" error.
    C c0ax_lx

    is frm_meter a static class? add some error handling: private void menuStrip_newFile_click(object sender, EventArgs e) { try{ frm_meter meter_control = new frm_meter(); meter_control.Show(); } catch (Exception ee) { MessageBox.Show(ee.message); } } atleast you should get a better error message. br Tomas

    If it' stuck, DO NOT pull harder!

    C# help debugging

  • Crystal reports, Dynamic parameter values not showing up , Static works fine
    C c0ax_lx

    Hi. i have a problem which i just cannot solve. i have created a crystal report with dynamic parameters , values are fetched from the database. it works fine when i run the report inside crystal reports 2008. but when i run the report in my software, visual studio 2005, C# (with crystal reports 2008 offcourse) i cannot get the list of values. if i add a static list of values it shows up just fine. so this: foreach ( ParameterField pf in m_ReportDocument.ParameterFields) { MessageBox.Show(pf.DefaultValues.Count.ToString()); } shows "5" if i add five static values, but "0" if i add dynamic values. Any suggestions? m_reportdocument is a crystal report document. the rtp is loaded and datasources are set. I've tried googling and searching business objects forums. i have seen the question but no replies. Cheers // Tomas

    If it' stuck, DO NOT pull harder!

    C# csharp help question database visual-studio

  • Delay in Webservice Functions
    C c0ax_lx

    I've struggled with this too. i found it was because internet explorer was set to automatically detect proxy settings. so. if it's set your program will try to find a proxy server and wait for timeout. add a proxy object: System.Net.WebProxy objProxy = new System.Net.WebProxy("http://1.2.3.5:8080/", true); YourService.Proxy = objProxy; or if you dont have a proxy YourService.Proxy = null; it might work.

    If it' stuck, DO NOT pull harder!

    C# csharp sysadmin performance question learning

  • Can radio button text be set at left instead of right
    C c0ax_lx

    Have you even looked at the properties? look at RightToLeft, either in the designer or in code: radioButton1.RightToLeft = RightToLeft.No;

    If it' stuck, DO NOT pull harder!

    C#

  • Thank you Canada
    C c0ax_lx

    heh. yepp. but dont forget Ed the sock .. still on swedish TV sometimes.. amusing ;]

    If it' stuck, DO NOT pull harder!

    The Lounge

  • How can I check if a node in a treeview allready exist ?
    C c0ax_lx

    That would not work, consider TreeNode tn1 = new TreeNode("item1"); TreeNode tn2 = new TreeNode("item1"); treeView1.Nodes.Add(tn1); if(!treeView1.Nodes.Contains(tn2)){ treeView1.Nodes.Add(tn2); }else{ // dont add node } treenode tn2 has the text as tn1, but it is not THE same treenode. but you could use the Name property and ContainsKey method TreeNode tn1 = new TreeNode("item1"); tn1.Name = "item1"; TreeNode tn2 = new TreeNode("item1"); tn2.Name ="item1"; treeView1.Nodes.Add(tn1); if(!treeView1.Nodes.ContainsKey(tn2.Name )){ treeView1.Nodes.Add(tn2); }else{ MessageBox.Show("node exists"); }

    If it' stuck, DO NOT pull harder!

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