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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
I

Islorvat

@Islorvat
About
Posts
11
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Socket server handling MySQL queries from clients and return the response to them
    I Islorvat

    Hello, Why would someone use this technique instead of letting apps directly query the MySQL server? Are there any security benefits or what? Thanks, Adrian

    C# database mysql sysadmin security question

  • OleDbDataReader - reading order
    I Islorvat

    It just didn't cross my mind to order by ID. :) Thanks!

    C# help database question

  • OleDbDataReader - reading order
    I Islorvat

    Hi guys, I've searched google but didn't find anything regarding this issue. I'm updating an MS Access table after reading some fields from the same table. While doing this i have a label to check how many rows have been processed out of total and i see that the reader jumps from an ID to another, process a few rows then comes back to the ID before jump happened. Is this thing normal? The table is created from an imported text file using Access.Application.DoCmd.TransferText. I thought compacting the database after import will fix this, but didn't. Any ideas? Thank you!

    C# help database question

  • List inside a struct
    I Islorvat

    Hello, Can anyone tell me how to use a List of strings inside a struct? I get the 'Object reference not set to an instance of an object.' error.

        public Form1()
        {
            InitializeComponent();
        }
    
        struct testStruct
        {
            public List<string> sList
            {
                get;
                set;
            }
    
        }
    
        private void Form1\_Load(object sender, EventArgs e)
        {
            testStruct aTestStruct = new testStruct();
            aTestStruct.sList.Add("test");
        }
    

    Thank you!

    C# help tutorial question

  • Moving the multiple files from one to another location
    I Islorvat

    Here is how i would do it:

           foreach (string f in Directory.GetFiles(@"C:\\MyFolder")) 
            {
                if (f.EndsWith(".xml")) 
                {
                    string currentf = f.Substring(f.LastIndexOf('\\\\') + 1); 
                    File.Move(f, @"C:\\MyFolder\\MyXmlFolder\\" + currentf); 
                }
            }
    

    It iterates through every file in MyFolder and if it's an xml then move it to MyXmlFolder.

    C# xml

  • Working with the UI while multithreading
    I Islorvat

    Thanks a lot!

    C# question design tutorial

  • Working with the UI while multithreading
    I Islorvat

    Hello! I am trying to understand more about threading but i can't find how to 'free' the UI from the threads working in the background. How can i use my form's controls or move/resize the window while a progressbar is updated from a loop in another thread? Here is the code:

        delegate void \_delegate(); 
    
        private void button1\_Click(object sender, EventArgs e)
        {
            Thread t1 = new Thread(new ThreadStart(ProgressUpdate));
            t1.Start();
        }
    
        void ProgressUpdate()
        {
            if (progressBar1.InvokeRequired)
            {
                progressBar1.Invoke(new \_delegate(Progress));    
            }
    
            else
            {
                for (int i = 1; i <= 100; i++)
                {
                    progressBar1.Value = (i \* 100) / 100;
                    Thread.Sleep(50);
                }
            }
        }
    
        void Progress()
        {
            for (int i = 1; i <= 100; i++)
            {
                progressBar1.Value = i;
                Thread.Sleep(50);
            }
        }
    
    C# question design tutorial

  • Application and Window's context menu
    I Islorvat

    Hello! I am using the windows context menu. My problem is that when i select multiple files the application will open as many times as selected files. In HKEY_CLASSES_ROOT\*\shell i have a key with the shortcut to my app and %1. Should the "%1" parameter be changed? Using the "SendTo" and creating a shortcut to the application will work as i wish, but how can i make it work the same way "SendTo" works for the context menu? I hope i made myself understood. I know this is more of a windows problem and not a C# one. Thanks!

    C# question csharp linux help

  • C# test if number exists in array and if not put it in
    I Islorvat

    You can try numbers.Contains(intRnd). Hope this helps. Good luck!

    C# csharp database data-structures

  • Catch Enter-key when focus on a button
    I Islorvat

    Hello! I am quite new to programming. I have no ideea how to cancel these 'automatic' key events that rise from hiting 'enter' or 'space' on a button but here is how i would do it: Set button's 'TabStop' to false. Create an 'enter' event and put this inside the event: SelectNextControl(yourbuttoncontrolhere, true, true, true, true); This won't allow the user to focus the control in any way but it will allow him to click the button. Hope this helps, Good luck!

    C# question help

  • Retrieve the control's name
    I Islorvat

    Hello! I'm working on an application wich will alow the user to add and remove controls. I want to apply different rules to textbox and this rules will be different for every textbox. For example i want to check wich control has been clicked by using a click event. Because i don't know how many textboxes will the user create i've decided to go along with the code below:

        private void Form1\_Load(object sender, EventArgs e)
        {
            foreach (Control ctrl in Controls)
            {
                ctrl.Click += new EventHandler(ctrl\_Click);
            }
        }
    
        void ctrl\_Click(object sender, EventArgs e)
        {
    
        }
    

    Is there anyway that i can get the name of the control that has been clicked? The sender.Tostring() only returns the type and the text of the control. Thanks! ;)

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