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
P

Polis Pilavas

@Polis Pilavas
About
Posts
130
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • launching the default email client from a C# app
    P Polis Pilavas

    You could create a new process with the "mailto" command:

    System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
    myProcess.StartInfo = new System.Diagnostics.ProcessStartInfo("mailto:admin@admin.com?subject=Subject text&body=Body text");
    myProcess.Start();

    Regards, Polis Can you practice what you teach?

    C# csharp tutorial question

  • File.Create method isn't releasing the file
    P Polis Pilavas

    What code are you using? I suspect that you didn't call the Close() method right after you created the file. We can't do much without seeing the actual code you use. But anyways, here's a sample code I use when creating/writing text files:

    FileStream fs = null;
    string tmpFile = "C:\\sample.txt";

    // Create file and close it so that it can be re-opened for writing further on
    fs = File.Create(tmpFile, 1024);
    fs.Close();

    // Prepare file for writing by assigning a new textWriter to it
    TextWriter wr = new StreamWriter(tmpFile);

    // Write stuff into the file
    wr.WriteLine("Stuff 1"); wr.WriteLine("Stuff 2"); wr.WriteLine("Blah blah blah......");

    // Eventually close the file
    wr.Close();

    Regards, Polis Can you practice what you teach? -- modified at 9:53 Thursday 15th December, 2005

    C# help

  • Changing all cursor types on a form
    P Polis Pilavas

    Assuming you are trying to change the cursors from within the form that the textboxes are on, you can try something like this:

    foreach (Control tmp in this.Controls)
    if (tmp is TextBox)
    tmp.Cursor = Cursors.Hand;

    Or like this:

    foreach (Control tmp in this.Controls)
    if (tmp.GetType().Name == "TextBox")
    tmp.Cursor = Cursors.Hand;

    Regards, Polis Can you practice what you teach?

    C# question

  • date validity
    P Polis Pilavas

    You can do that quite easily by writing your code inside a try/catch block like below:

    try
    {
    DateTime tmp = DateTime.Parse(this.textBox1.Text);
    }
    catch (Exception exc)
    {
    MessageBox.Show("This is not a valid date\n\nError Message: " + exc.Message);
    return;
    }
    MessageBox.Show("Date is valid");

    Regards, Polis Can you practice what you teach?

    C# question

  • To Convert Julian Time Calendar Date?
    P Polis Pilavas

    Take a look here[^], or here[^]. Regards, Polis Can you practice what you teach?

    C# help question

  • Playing Audio Files in .NET
    P Polis Pilavas

    You can try using the Windows Media Player control. This[^] is a good place to start from. However, you can always google it[^]. Regards, Polis Can you practice what you teach?

    C# csharp question

  • How to raise Mouse click event
    P Polis Pilavas

    Can you rephrase the question please? Regards, Polis Can you practice what you teach?

    C# tutorial question

  • Open an excel document
    P Polis Pilavas

    Take a look here[^]. Regards, Polis Can you practice what you teach?

    C# csharp tutorial

  • pdf search
    P Polis Pilavas

    I don't know whether these libraries[^] can help you, but take a look Regards, Polis Can you practice what you teach?

    C# question

  • Crystal Reprt
    P Polis Pilavas

    Why don't u google[^] it? Regards, Polis Can you practice what you teach?

    C# question

  • Implementing cut, copy, paste, undo, select all
    P Polis Pilavas

    monrobot13 wrote:

    If I put a menu on my form and add and edit menu that has Cut, Copy, Paste, etc and the default shortcut keys Ctrl X, Ctrl C, etc then the textboxes no longer have that functionality

    My guess would be that you are overriding the default textbox menu with your own, so in essence this is why you're disabling the default behavior. So if this is the case, I guess you would have to re-implement this kind of behaviour in your new menu. I don't know whether you can merge the default functionality with your own. But then again, why on earth would you want to do that?? Correct me if I am wrong, but it's like re-inventing the wheel... isn't it? Regards, Polis Can you practice what you teach?

    C# question help

  • Windows Form
    P Polis Pilavas

    Try hiding your "parent" form instead and re-show it when you're done with the "child" (frmGUI) one:

    SecurityGUI.frmGUI frm = new frmGUI();
    this.Hide();
    frm.ShowDialog();
    this.Show();

    This will work fine since after closing the child form, the applications' control will return to the line that immediately follows the ShowDialog() method. Regards, Polis Can you practice what you teach?

    C# csharp help question workspace

  • Implement CheckBoxes in Listbox?
    P Polis Pilavas

    Yes, take a look below at the following self-explanatory code chunk. First I add three items into the checkedListBox, and then I get the text of the selected ones by looping through each one of them:

    string checkedItems = "";

    // Add a few items into the checkedListBox control
    this.checkedListBox1.Items.Add("Item 1", CheckState.Checked);
    this.checkedListBox1.Items.Add("Item 2", CheckState.Indeterminate);
    this.checkedListBox1.Items.Add("Item 3", CheckState.Unchecked);

    // Retrieve the selected items in a string
    for (int i = 0; i < this.checkedListBox1.Items.Count; i++)
    {
    if (this.checkedListBox1.GetItemChecked(i))
    checkedItems += this.checkedListBox1.Items[i].ToString() + "\n";
    }

    MessageBox.Show(checkedItems);

    Regards, Polis Can you practice what you teach?

    C# question winforms

  • Login failure needs to close main app...
    P Polis Pilavas

    Try putting your code into the form's Load() event instead. Regards, Polis Can you practice what you teach?

    C# database regex help question

  • How can I Create and use Custom Controls ?
    P Polis Pilavas

    Try googling it[^]. You'll get loads of results Regards, Polis Can you practice what you teach?

    C# csharp question asp-net

  • Implement CheckBoxes in Listbox?
    P Polis Pilavas

    Look for a Windows forms' control called CheckedListBox in your toolbox instead Regards, Polis Can you practice what you teach?

    C# question winforms

  • Upper case on DataGrid
    P Polis Pilavas

    Take a look here[^]. There is a LOT of stuff for datagrid up there. Regards, Polis Can you practice what you teach?

    C# question

  • creating a progress dialog box
    P Polis Pilavas

    Take a look here[^]. Even though it deals with ADO.NET v2.0, it's quite similar to your case and it explains how to increment the progressBar control according to the records in your table. Regards, Polis Can you practice what you teach?

    C# database

  • Accessing Dynamically Added User Controls
    P Polis Pilavas

    You could write something like this:

    // Add "monitor1" on tab1
    TabPage tab1 = new TabPage("Tab 1");
    MonitorTabs.TabPages.Add(tab1);

    MonitorTab monitor1 = new MonitorTab();
    tab1.Controls.Add(monitor1);

    // Add "monitor2" on tab2
    TabPage tab2 = new TabPage("Tab 2");
    MonitorTabs.TabPages.Add(tab2);

    MonitorTab monitor2 = new MonitorTab();
    tab2.Controls.Add(monitor2);

    // And so on...

    This way, you know that tab1 has monitor1 on it, and tab2 has monitor2. So if the selectedTab is tab1 then you access monitor1 by writing something like this.monitor1 Hope this makes sense. Regards, Polis Can you practice what you teach?

    C# winforms help tutorial question

  • Accessing Dynamically Added User Controls
    P Polis Pilavas

    Hmm... if I get it right, I would keep track of each Monitor's instance name on each tab (e.g. I would add "Monitor1" on tab1, "Monitor2" on tab2 and so on. Then, in order to access them, I would locate them by their names). Regards, Polis Can you practice what you teach?

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