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
Z

Zaegra

@Zaegra
About
Posts
178
Topics
67
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • TreeNode sorting problem
    Z Zaegra

    I don't know if you know the GEDCOM file format (.ged, genealogy file standard[^]), but I'm trying to read one and I want to put it in a listview. The following code opens a gedcom file, and saves the data (per person) to a treeview.

    StreamReader reader = new StreamReader(@"test.ged");
    string[] lines;
    string file_content = reader.ReadToEnd();
    lines = file_content.Split(Environment.NewLine.ToCharArray()[0]);
    this.Text = lines.Length.ToString();

            TreeNode currentperson = new TreeNode();
            foreach(string line in lines)
            {
                string newline = line.Replace("\\n", "");
                newline = newline.Replace("\\r", "");
    
                try
                {
                    if (newline\[0\].ToString() == "0")
                    {
                        //MessageBox.Show("newperson wotwot!");
                        newline = newline.Replace("@", "");
                        newline = newline.Replace("0", "");
                        newline = newline.Replace("INDI", "");
                        TreeNode newperson = new TreeNode(newline);
                        gedcomtree.Nodes.Add(newperson);
                        currentperson = newperson;
                    }
                    else
                    {
                        TreeNode currentnode = new TreeNode(newline);
                        currentperson.Nodes.Add(currentnode);
                    }
                }
                catch { }
            }
    

    Now my question is: How can i sort the elements in a persons' node aswell? Example: 1 BIRT 2 DATE 01 FEB 1750 2 PLAC EDINBURGH 3 NOTE Old place. 1 DEAT 2 DATE 02 FEB 1800 etc. Should make: - BIRT -- DATE 01 FEB 1750 -- PLAC EDINGBURGH --- NOTE Old place. - DEAT -- DATE 02 FEB 1800 (In a treeview) Could someone help me out on this one? Im trying to get this to work for 3 days now, and i'm still stuck :sigh: Thanks in advance, Zaegra

    Motivation is the key to software development.

    C# help question algorithms tutorial workspace

  • Draw a line avoiding objects
    Z Zaegra

    Hello, I have a problem: I want to draw a line between object A (Say an ellipse) and object B (also an ellipse). Now, between those object lies object C (which is a triangle). Now how can I draw the shortest line between A and B avoiding object C, using GDI+? Thanks in advance, Zaegra

    Motivation is the key to software development.

    C# question winforms graphics help

  • Custom item list
    Z Zaegra

    :-O

    Motivation is the key to software development.

    C# help question

  • Custom item list
    Z Zaegra

    Hi, I was wondering: I have an user-control called myUserControl. This control contains items, say myUserControlItems. Now I want to add a property to myUserControl, which contains a list of myUserControlItems. So:

    myUserControl usrctrl = new myUserControl();
    myUserControlItem usritem = new myUserControlItem();
    myUserControl.Items.Add(usritem);

    I can accomplish this by setting the type of the property to myUserControlItem[], but this isn't as dynamic as e.g Listviewitems in a ListView. Can somebody help me out on this one? Greets, Zaegra

    Motivation is the key to software development.

    C# help question

  • Copyright Question
    Z Zaegra

    That question is easy to answer: That thread has been abandoned a million years ago, plus, I find the Codeproject a very reliable source of information. That's why I posted the question here, and not there ;)

    Motivation is the key to software development.

    C# question csharp php html database

  • Copyright Question
    Z Zaegra

    stancrm wrote:

    I think

    I need more certainty than that, but thanks for your reply. :) Anyone else knows? :confused:

    Motivation is the key to software development.

    C# question csharp php html database

  • Copyright Question
    Z Zaegra

    Hi guys, I've implemented the code from http://www.neowin.net/forum/lofiversion/index.php/t180600.html[^] into my project (the latest post). Now I wondered: If I go commercial, is the use of the Windows file copy utility legal? This is of great importance, since almost my entire project depends on this code. Thanks in advance, Zaegra

    Motivation is the key to software development.

    C# question csharp php html database

  • Stretch to parent control
    Z Zaegra

    That's exactly what I need, thanks Luc! :-D

    Motivation is the key to software development.

    C# performance help tutorial

  • Stretch to parent control
    Z Zaegra

    Well, the link provided below contains an AVI file with what I am trying to accomplish. It will definately clarify things. [url=http://www1.zippyshare.com/v/64422131/file.html\]example.avi[/url] Even in the example you can see the flicker that occurs. Below is the code that i'm using for the 'animation': (PS: panel1 is the panel that contains the listview that needs to be stretched)

    public void Animate(Control Ctrl, int Steps)
    {
    Bitmap OriginalView = new Bitmap(Ctrl.Width, Ctrl.Height);
    Ctrl.DrawToBitmap(OriginalView, new Rectangle(0,0,Ctrl.Width,Ctrl.Height));
    int ParentWidth = (int)Ctrl.Parent.Width;
    int ParentHeight = (int)Ctrl.Parent.Height;
    int wGrowth = (int)(ParentWidth - Ctrl.Width)/Steps;
    int hGrowth = (int) (ParentHeight - Ctrl.Height)/Steps;
    panel1.BackgroundImage = OriginalView;
    Ctrl.Visible = false;

            for (int i = 0; i < Steps; i++)
            {
                Bitmap NewRender = new Bitmap(OriginalView, new Size(OriginalView.Size.Width + i\*wGrowth, OriginalView.Size.Height + i\*hGrowth));
                panel1.BackgroundImage = NewRender;
                panel1.Update(); 
            }
            GC.Collect();
            Ctrl.Visible = true;
            panel1.BackgroundImage = null;
            panel1.Update();
            
    
        }
    

    And to end up: The dispose method won't work. If i do it throws me all sorts of error of which I still have to find out their sources... Thanks again for your time and idea's, Zaegra

    Motivation is the key to software development.

    C# performance help tutorial

  • Stretch to parent control
    Z Zaegra

    I'm talking about a listview, but it should basically work for every control. I need to: 1) Create a bitmap of the control using Control.ToBitmap(), 2) Calculate the aspects ratio between the size of the control and it's parent and 3) Stretch the bitmap and draw it. 4) Repeat so that it looks like an animation. But I've tried to set the backgroundimage, but it won't redraw automatically. Therefore I implemented the Control.Update() method, but this results in a) Good Animation but b) Flicker. And I don't want the flicker :) You understand? :) Thanks for your interest! Zaegra

    Motivation is the key to software development.

    C# performance help tutorial

  • Stretch to parent control
    Z Zaegra

    LimitedAtonement wrote:

    Dear Mr. Viagra

    :laugh: Well, that's not really what i'm trying to accomplish. This stretches the entire control, and thereby changes the interior arrangement of the items (e.g a listview). It has to look like the control "freezes", then stretches to it's parent size and when it has reached that size it can return to it's old size. Don't ask me why, it's just a fancy GUI animation. And I know i can do this by using DrawToBitmap (which basically makes a screenshot of the control) and stretching that. But when I do that, the animation flickers because I have to use the .Update() method on the control. Any more idea's? :0 Thanks for your reply though, it gave me some idea's , but just not enough ;) Greets, Zaegra

    Motivation is the key to software development.

    C# performance help tutorial

  • Stretch to parent control
    Z Zaegra

    Hey, I'd like a control to stretch to it's parents' size in several steps. I have accomplished this, but the result isn't statisfying. This is because im using (Control.) DrawToBitmap in a for loop, which builds up memory pretty fast. I can solve this by using GC.Collect(), but that doesn't look very professional. Thus i'm looking for an alternative, that makes a control stretch in several steps (as in an animation) without flickering. (Perfectly smooth) I'd appreciate some ideas on how to solve this problem ;) Thanks in advance, Zaegra

    Motivation is the key to software development.

    C# performance help tutorial

  • HowTo Avoid Flicker
    Z Zaegra

    Heya, I have the following code that stretches a control to its parent size in a given number of steps. However, the panel1.update() method causes the screen to flicker. Is there a workaround for this, so that the animation will run smooth?

    public void Animate(Control Ctrl, int Steps)
    {
    Bitmap OriginalView = new Bitmap(Ctrl.Width, Ctrl.Height);
    Ctrl.DrawToBitmap(OriginalView, new Rectangle(0,0,Ctrl.Width,Ctrl.Height));
    int ParentWidth = (int)Ctrl.Parent.Width;
    int ParentHeight = (int)Ctrl.Parent.Height;
    int wGrowth = (int)(ParentWidth - Ctrl.Width)/Steps;
    int hGrowth = (int) (ParentHeight - Ctrl.Height)/Steps;
    panel1.BackgroundImage = OriginalView;
    Ctrl.Visible = false;

            for (int i = 0; i < Steps; i++)
            {
                Bitmap NewRender = new Bitmap(OriginalView, new Size(OriginalView.Size.Width + i\*wGrowth, OriginalView.Size.Height + i\*hGrowth));
                panel1.BackgroundImage = NewRender;
                panel1.Update(); 
            }
            GC.Collect();
            Ctrl.Visible = true;
            panel1.BackgroundImage = null;
            panel1.Update();
            
    
        }
    

    Thanks in advance, Zaegra

    Motivation is the key to software development.

    C# graphics question announcement

  • SQL update problem
    Z Zaegra

    Hey, We are making a game like travian (www.travian.com) in php and SQL. Now we are facing a serious problem. We have the following example: Player A attacks player B, and this attack takes 1 hour. In the meantime player A and B are logged out. But the attack must be performed, since their teammates would like to know the status of the attack too. Now how can we execute a certain code at a specific time, NOT using players, so on the server? We're using a SQL database, and the coding is done in Php. I heard something about Stored Procedures...? Thanks in advance, Zaegra

    Motivation is the key to software development.

    Web Development database php com game-dev sysadmin

  • How to get rearm count
    Z Zaegra

    Explain 'Rearm Count'?

    Motivation is the key to software development.

    C# csharp help tutorial

  • Void Dividers in Code View
    Z Zaegra

    Hey, I just recently went from VB to C#, and I must admit a lot of things are better. But the thing I miss most are the void dividers (grey bar) between the voids in Code View, which VB had. Is there a way to get these back? :rolleyes: Thanks in advance, Zaegra

    Motivation is the key to software development.

    C# csharp question

  • ListView Scrolling
    Z Zaegra

    Using WinForms :-\ But I don't care about the internal layout of the Listview, I only need to know if a listview has focus, if the scrollwheel is scrolled. And if so, if it was scrolled up or down.. Can't seem to find anything fitting this purpose. Any ideas on this?

    Motivation is the key to software development.

    modified on Tuesday, October 13, 2009 2:24 PM

    C# csharp help question

  • ListView Scrolling
    Z Zaegra

    Hello, I'd like to know if a user scrolls my ListView, since .NET (weird?) doesn't support this. Now I've found several articles (on Google) which tell me I need to create a Virtual ListView and override WndProc. I've done this but: 1) The control is terribly slow, and I can't just drag it on the form, meaning I need to create it in code. Is there any easy way to check if a NORMAL ListView gets scrolled? I also need to know the difference between Scrolling Up, and Scrolling Down. Please help me out, Zaegra

    Motivation is the key to software development.

    C# csharp help question

  • Reroute an Application's Network Traffic
    Z Zaegra

    Thanks! I will try this :D:D

    Motivation is the key to software development.

    C# sysadmin game-dev question

  • Reroute an Application's Network Traffic
    Z Zaegra

    Hello, I'd like to know if it's possible to "wrap" a running process, and get all it's Outgoing network traffic? E.g when I'm playing a game, trap its network traffic and send it to a different server? :O PS: This is not used for any form of hacking. Thanks in advance, Zaegra

    Motivation is the key to software development.

    C# sysadmin game-dev 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