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. Visual Basic
  4. how to find a winform by name in VS project?

how to find a winform by name in VS project?

Scheduled Pinned Locked Moved Visual Basic
visual-studiotutorialquestion
2 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
    sanyexian
    wrote on last edited by
    #1

    Hello,everyone! I want to find a winform by its name in my project. At first, I thougt it could return the specific form with codes like below:

    for each iForm as Form in XXX
    'do someting
    return iForm
    next

    Is this right or not? If right, what's the collection included forms of project? If wrong, what should I do? Would you give me some suggestions or demo? Thanks!

    L 1 Reply Last reply
    0
    • S sanyexian

      Hello,everyone! I want to find a winform by its name in my project. At first, I thougt it could return the specific form with codes like below:

      for each iForm as Form in XXX
      'do someting
      return iForm
      next

      Is this right or not? If right, what's the collection included forms of project? If wrong, what should I do? Would you give me some suggestions or demo? Thanks!

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      if it is a visible form belonging to your own process, iterate the Application.OpenForms collection. Otherwise, you will need to enumerate all the Windows windows using the EnumWindows[^] function (in user32.dll) using P/Invoke. :)

      Luc Pattyn [My Articles] Nil Volentibus Arduum

      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