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. How to get the value from a variable and use it eg Form.VariableValue

How to get the value from a variable and use it eg Form.VariableValue

Scheduled Pinned Locked Moved C#
helpquestiontutorial
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.
  • M Offline
    M Offline
    MarkB123
    wrote on last edited by
    #1

    Hi all, can someone help with the following issue I'm having. I am returning a dataset with a list of names of screen objects for a form. I am trying to loop round the dataset, pick up the name then get the type of the control. As follows... foreach (DataRow row in dataSet_Groups.sp091_load_user_screen_components_layout.Rows) { strObjectName = Convert.ToString(row["ScreenObjectName"]); strXMLText = Convert.ToString(row["XMLText"]); intX = Convert.ToInt32(row["X"]); intY = Convert.ToInt32(row["Y"]); intWidth = Convert.ToInt32(row["Width"]); intHeight = Convert.ToInt32(row["Weight"]); intPosition = Convert.ToInt32(row["Position"]); ctrlOnForm = frmToProcess.strObjectName; switch (ctrlOnForm.GetType().FullName) { case "textEdit": break; } } frmToProcess is the form in question. How do I get the the value out of strObjectName and link it onto the the form name so I can check it's properties (see bold part in code). It's almost as if I need to perform Macro substitution (from my old FoxPro days)! Sorry if my description is confusing. Thanks.

    X 1 Reply Last reply
    0
    • M MarkB123

      Hi all, can someone help with the following issue I'm having. I am returning a dataset with a list of names of screen objects for a form. I am trying to loop round the dataset, pick up the name then get the type of the control. As follows... foreach (DataRow row in dataSet_Groups.sp091_load_user_screen_components_layout.Rows) { strObjectName = Convert.ToString(row["ScreenObjectName"]); strXMLText = Convert.ToString(row["XMLText"]); intX = Convert.ToInt32(row["X"]); intY = Convert.ToInt32(row["Y"]); intWidth = Convert.ToInt32(row["Width"]); intHeight = Convert.ToInt32(row["Weight"]); intPosition = Convert.ToInt32(row["Position"]); ctrlOnForm = frmToProcess.strObjectName; switch (ctrlOnForm.GetType().FullName) { case "textEdit": break; } } frmToProcess is the form in question. How do I get the the value out of strObjectName and link it onto the the form name so I can check it's properties (see bold part in code). It's almost as if I need to perform Macro substitution (from my old FoxPro days)! Sorry if my description is confusing. Thanks.

      X Offline
      X Offline
      Xmen Real
      wrote on last edited by
      #2

      this.Controls.Find(strObjectName, true);

      TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

      M 1 Reply Last reply
      0
      • X Xmen Real

        this.Controls.Find(strObjectName, true);

        TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

        M Offline
        M Offline
        MarkB123
        wrote on last edited by
        #3

        Perfect - many thanks.

        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