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. what exactly below code do

what exactly below code do

Scheduled Pinned Locked Moved C#
4 Posts 4 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.
  • A Offline
    A Offline
    anil420
    wrote on last edited by
    #1

    foreach (TabItem ti in MainWindow.mw.tcMain.Items)
    {
    if (Convert.ToInt16(ti.Tag) == r.id)
    {
    MainWindow.mw.tcMain.SelectedItem = ti;
    return;
    }
    }

    H OriginalGriffO Z 3 Replies Last reply
    0
    • A anil420

      foreach (TabItem ti in MainWindow.mw.tcMain.Items)
      {
      if (Convert.ToInt16(ti.Tag) == r.id)
      {
      MainWindow.mw.tcMain.SelectedItem = ti;
      return;
      }
      }

      H Offline
      H Offline
      Hemant Singh Rautela
      wrote on last edited by
      #2

      Who write this code ask to him... :-)

      1 Reply Last reply
      0
      • A anil420

        foreach (TabItem ti in MainWindow.mw.tcMain.Items)
        {
        if (Convert.ToInt16(ti.Tag) == r.id)
        {
        MainWindow.mw.tcMain.SelectedItem = ti;
        return;
        }
        }

        OriginalGriffO Offline
        OriginalGriffO Offline
        OriginalGriff
        wrote on last edited by
        #3

        Finds an item in the tab control with a matching ID value, and sets it as the selected tab item. It relies on you having set the appropriate ID value into the Tag property of each TabItem when you created it, however. And in future, please ask WPF queries in the WPF forum: http://www.codeproject.com/Forums/1004257/Silverlight-WPF.aspx[^]

        Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952) Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

        1 Reply Last reply
        0
        • A anil420

          foreach (TabItem ti in MainWindow.mw.tcMain.Items)
          {
          if (Convert.ToInt16(ti.Tag) == r.id)
          {
          MainWindow.mw.tcMain.SelectedItem = ti;
          return;
          }
          }

          Z Offline
          Z Offline
          ZurdoDev
          wrote on last edited by
          #4

          Please do not cross post.

          There are only 10 types of people in the world, those who understand binary and those who don't.

          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