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
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. C++/CLI -- Where to declare pre-selected list box and radio button attributes?

C++/CLI -- Where to declare pre-selected list box and radio button attributes?

Scheduled Pinned Locked Moved Managed C++/CLI
helpc++winformsdesignquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    J_E_D_I
    wrote on last edited by
    #1

    listBox1->SelectedItem = "---- SELECT! ----";
    listBox2->SelectedItem = "---- SELECT! ----";
    radioButton1->Checked = true;
    radioButton2->Checked = true;

    Hi guys, I need my application to start with some pre-selected items in the list boxes and radio buttons, and I can achieve this by manually pasting the code above between the lines of the code which is automatically generated by VS2008 (using Windows Forms). By doing this the program works however the GUI Design page gets really screwed up and I loose the ability to make any further editing! Where do these attributes have to be inserted? I have tried in the main{} section but it returns an error. Help please!!

    M 1 Reply Last reply
    0
    • J J_E_D_I

      listBox1->SelectedItem = "---- SELECT! ----";
      listBox2->SelectedItem = "---- SELECT! ----";
      radioButton1->Checked = true;
      radioButton2->Checked = true;

      Hi guys, I need my application to start with some pre-selected items in the list boxes and radio buttons, and I can achieve this by manually pasting the code above between the lines of the code which is automatically generated by VS2008 (using Windows Forms). By doing this the program works however the GUI Design page gets really screwed up and I loose the ability to make any further editing! Where do these attributes have to be inserted? I have tried in the main{} section but it returns an error. Help please!!

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      In general, you shouldn't edit any designer-generated code. I don't do Windows Forms, but I believe typically you'd do those kinds of initializations in response to the Load event. You can add event handlers from the properties pane for your form and or controls. Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      J 1 Reply Last reply
      0
      • M Mark Salsbery

        In general, you shouldn't edit any designer-generated code. I don't do Windows Forms, but I believe typically you'd do those kinds of initializations in response to the Load event. You can add event handlers from the properties pane for your form and or controls. Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        J Offline
        J Offline
        J_E_D_I
        wrote on last edited by
        #3

        Thanks for the advice, it works very well and the designer page is not affected. It all needs to go into the Load event. Cheers

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups