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
L

Lim Yuxuan

@Lim Yuxuan
About
Posts
24
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Problem with Form
    L Lim Yuxuan

    thanks

    C# help question

  • Problem with Form
    L Lim Yuxuan

    Erm.. where should I put the

    Application.OpenForms[0].Show();

    code ? I cant find an event handler that triggers when you closes a form.

    C# help question

  • Problem with Form
    L Lim Yuxuan

    Yup Its a tic-tac-toe. I am using labels for the "O" and "X". But. I think I will use MDI instead because I could not figure out where to put the

    frmMenu.Show();

    code to show the menu form once i close the game form (I could not find any event handler that triggers when you close the form). EDIT:

    Application.OpenForms collection would help out then.

    oh wait ...

    modified on Monday, September 14, 2009 7:26 PM

    C# help question

  • Problem with Form
    L Lim Yuxuan

    Thanks it worked the way I wanted it to be.

    C# help question

  • Problem with Form
    L Lim Yuxuan

    where are you calling your initial frmMenu form from?
    I think your problem is you are creating frm2Players from within frmMenu which means when that closes it will close all children.

    Yup. That is what happens when I tried to execute the .Close() method. I tried d@nish 's method and it worked the way I wanted it to be. Thanks anyway :)

    C# help question

  • Problem with Form
    L Lim Yuxuan

    The menu form did closed but it seems that if the menu form is closed, the new form is closed together with it ... hmm maybe I should try MDI ?

    C# help question

  • Problem with Form
    L Lim Yuxuan

    Yes. btn2Player calls a new form and after calling the new form, it will remove the old one (menu form)

    C# help question

  • Problem with Form
    L Lim Yuxuan

    Hi guys,I have a program that starts with a menu form. It will create a new form and remove the menu form after the user pressed a certain button. So I tried the following method :

    private void btn2Player_Click(object sender, EventArgs e)
    {
    frmMenu frmMenu = new frmMenu();// menu form
    frm2Players frm2P = new frm2Players();//new form
    frm2P.Show();//display new form
    frmMenu.Close();//Close the menu form
    }

    The new form that it is supposed to create shows up but strangely the menu form is still there. What should I do ?

    C# help question

  • File Not Found Exception Handling
    L Lim Yuxuan

    thanks it worked well that way.

    C# csharp debugging question

  • File Not Found Exception Handling
    L Lim Yuxuan

    Hi I am trying to handle a file not found exception by creating the specified text file if it does not exists. void RetrieveData() { if(File.Exists("books.txt") == false) // if file doesnt exists { File.Create("books.txt"); // create the file } //Create a stream reader object to read from "books.txt" StreamReader DataReader = new StreamReader("books.txt"); } I did a test run and remove the books.txt file from the current working directory on purpose and when i start debugging all I get is this exception : The process cannot access the file 'C:\Documents and Settings\Administrator\My Documents\NYP Work\C#\MiniProject 2009\PhotoAlbum_V2\bin\Debug\books.txt' because it is being used by another process. Any suggested solutions ?

    C# csharp debugging question

  • How do i retrieve the directory of multiple images file without hard code ?
    L Lim Yuxuan

    Thanks

    C# question database data-structures tutorial

  • How do i retrieve the directory of multiple images file without hard code ?
    L Lim Yuxuan

    Hi. I had a photo album project and I was wondering is there anyway to retrieve the directory of images with minimum hardcoding ? What I am currently doing now is this : //prefix of the directory of large images const string strLargePrefix = "/images/large/"; //suffix of the directory of large images const string strLargeSuffix = "_large.jpg"; //group the pictures together with each of them assigned with a reference number enum enuImages { //note that the first image will have its reference number //as its position number-1.Example: 2nd image = 2-1 = reference number 1 cHTP3 =0, //1st image cppHTP4 = 1, //second image csharpFEP1 = 2,//third image jHTP4 = 3, //4th image jwsFEP1 =4, //5th image vbnetFEP1 = 5 //6th image } RetrieveData() { // An enumeration object that represents the images based on their // reference number. Initial reference set to 1st image enuImages m_Images = 0; //Array index of the image to be stored at base on their reference number. //Index number has the same value as reference number. int intIndex = 0; //Retrieve directory path of the Large images and sort them for (intIndex = 0; intIndex < int_TotalImages; intIndex++ ) { strLargeImage[intIndex] = Directory.GetCurrentDirectory() + strLargePrefix + m_Images + strLargeSuffix; m_Images++;//increment the reference number to represent next image }// end for loop } I dont really like the idea of grouping the images together because I have to hard code the names of the image file. But I have no choice as it works with the for loop. Is there any method that behaves like the file.ReadAllLines() that can retrieve all the images from that folder and return them as a form of array ?

    C# question database data-structures tutorial

  • pseudorandom number generator algorithm
    L Lim Yuxuan

    LOL. It is a pratical random generator. I used to write numbers on my square eraser and toss them to decide my answer for Multiple Choice Questions during tests that I didnt study.

    Algorithms algorithms question lounge

  • richtextbox 's DetectUrls property
    L Lim Yuxuan

    Thanks it worked.

    C# question

  • richtextbox 's DetectUrls property
    L Lim Yuxuan

    I had set the DetectUrls property of the richtextbox object to true. When I typed an URL address, the address would be automatically underlined and the color of the font would be in blue and when ever I move the cursor over the address, it will change from an "I beam" to a "hand". However, when I clicked the url, nothing happened. I expected the Internet Explorer 's window to pop out. Can anyone tell me what should I do ?

    C# question

  • Need help with Backspace button!!
    L Lim Yuxuan

    Thanks. I have read the description of the remove method from the intellisense and it explains alot.

    C# tutorial question help

  • Need help with Backspace button!!
    L Lim Yuxuan

    Thanks. I read the description of the remove method from the intellisense and it explains alot.

    C# tutorial question help

  • Need help with Backspace button!!
    L Lim Yuxuan

    Hi ! I am designing a simple calculator application and I am having trouble coding the backspace button. I store the data that the user had input in a string by the name of strInput with initial value strInput = "" . I display the value that the user had clicked by coding : lblDisplayPanel.Text+="value of button"; For example, lets take a look at my button 1 private void btn1_Click(object sender, EventArgs e) { lblDisplayPanel.Text += "1"; } so when I click button 1 thrice, the display panel will show "111". However, I only know how to add values to the display panel label. I tried -= but it wont work . The backspace button is supposed to remove the last value entered by the user but how do I do that ?

    C# tutorial question help

  • How do programmers relax?
    L Lim Yuxuan

    Go get some tibits to eat or make myself a sandwich.

    The Lounge question

  • How do I create a label thats display the time like a digital clock ?
    L Lim Yuxuan

    Thanks for your efforts guys. In the end this is what I did. private Timer Clock = new Timer();//create a timer void Clock_Tick(object sender, EventArgs e) { //refresh the time every 1 second this.winFormTimerLabel.Text = DateTime.Now.ToLongTimeString(); } private void Form1_Load(object sender, EventArgs e) { Clock.Interval = 1000;//every 1 second do something //what the program is supposed to do when 1 second elasped Clock.Tick += new EventHandler(Clock_Tick); Clock.Start();//starts the timer } I finally understood where did I went wrong - I did not put in the interval value and I did not start the timer..... silly me :laugh:

    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