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. C#
  4. A few questions

A few questions

Scheduled Pinned Locked Moved C#
questioncsharpvisual-studiohelptutorial
4 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.
  • S Offline
    S Offline
    SRJ92
    wrote on last edited by
    #1

    Hello, I am working in visual studio to make a project which requires using lists. I need a little help to complete this. The first thing I need to know is how to select a top result in a list, so that its highlighted, just like when you click. How would I code this so that it works with the down arrow, I know you use keycode etc, but can’t figure out the way to highlight it …. Then when I press enter I want to select the list item… Thanks… Next, I have two forms and trying to make a “find and replace” function, so this requires looking on a richtextbox in the first form and when a button is clicked on the find and replace form it should effect it. My question is however, how do you connect to another form ? because I have no idea what to do …. Last question, I need to know a quickly print and print preview a rich text box, thanks for all your help Steve

    L 1 Reply Last reply
    0
    • S SRJ92

      Hello, I am working in visual studio to make a project which requires using lists. I need a little help to complete this. The first thing I need to know is how to select a top result in a list, so that its highlighted, just like when you click. How would I code this so that it works with the down arrow, I know you use keycode etc, but can’t figure out the way to highlight it …. Then when I press enter I want to select the list item… Thanks… Next, I have two forms and trying to make a “find and replace” function, so this requires looking on a richtextbox in the first form and when a button is clicked on the find and replace form it should effect it. My question is however, how do you connect to another form ? because I have no idea what to do …. Last question, I need to know a quickly print and print preview a rich text box, thanks for all your help Steve

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      SRJ92 wrote:

      The first thing I need to know is how to select a top result in a list, so that its highlighted, just like when you click.

      Sounds like a ListBox[^]. The link also has a code-example on selecting specific items.

      SRJ92 wrote:

      Then when I press enter I want to select the list item…

      I believe that you can do that already using the space-bar, allowing for multiple selections. Perhaps you could replace the "return"-keypress with a space-character?

      SRJ92 wrote:

      My question is however, how do you connect to another form ?

      You'd "show" Form2 from Form1. Information can be passed by creating additional properties in Form2.

      SRJ92 wrote:

      I need to know a quickly print and print preview a rich text box

      That's not supported out of the box - you'd either need to program it or find a third-party product to provide that functionality.

      I are Troll :suss:

      S 1 Reply Last reply
      0
      • L Lost User

        SRJ92 wrote:

        The first thing I need to know is how to select a top result in a list, so that its highlighted, just like when you click.

        Sounds like a ListBox[^]. The link also has a code-example on selecting specific items.

        SRJ92 wrote:

        Then when I press enter I want to select the list item…

        I believe that you can do that already using the space-bar, allowing for multiple selections. Perhaps you could replace the "return"-keypress with a space-character?

        SRJ92 wrote:

        My question is however, how do you connect to another form ?

        You'd "show" Form2 from Form1. Information can be passed by creating additional properties in Form2.

        SRJ92 wrote:

        I need to know a quickly print and print preview a rich text box

        That's not supported out of the box - you'd either need to program it or find a third-party product to provide that functionality.

        I are Troll :suss:

        S Offline
        S Offline
        SRJ92
        wrote on last edited by
        #3

        how exactly do i "show" Form 1 to Form 2 ?? Thanks

        L 1 Reply Last reply
        0
        • S SRJ92

          how exactly do i "show" Form 1 to Form 2 ?? Thanks

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          By calling the Show[^] method of the form;

          Form1 myForm = new Form1();

          void Button1_Click(object sender, EventArgs e)
          {
          myForm.Show(this);
          }

          Although I'd prefer names like "MainForm" and "SearchAndReplaceForm" :)

          I are Troll :suss:

          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