| | |
Nee help with sending text to child windows
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jan 2005
Posts: 11
Reputation:
Solved Threads: 0
How do I send text to a child window? I want to press a button and it sends the text. I am trying to store all of my CD-keys for my games in a program and then send the text to the boxes in the appropriate areas for each game. I have everything done but I can't figure out how to send the key's to the child windows. Can someone give me an example for starcraft, here are the window names and other things I found with Spy++.
Parent Window:
Caption: Starcraft Setup
Class: BlizzardSetup
Style: 1CCA0000
Child Window:
Caption: Starcraft - CD-Key.
Class: #32770 (Dialog)
Style: 94C800C4
Parent Window:
Caption: Starcraft Setup
Class: BlizzardSetup
Style: 1CCA0000
Child Window:
Caption: Starcraft - CD-Key.
Class: #32770 (Dialog)
Style: 94C800C4
Last edited by Demond; Jan 11th, 2008 at 2:02 am.
•
•
Join Date: Apr 2006
Posts: 88
Reputation:
Solved Threads: 2
Okay I had time to get some code for you.
First you need to create the class Game or whatever you wish to call it. Feel free to add different properties.
Next you need to create the class and then fill the object with data.
After that pass the object Game to the child window. Use some code like this to populate the child window on the load event.
Keep adding different textboxes or whatever control for each property.
First you need to create the class Game or whatever you wish to call it. Feel free to add different properties.
C# Syntax (Toggle Plain Text)
class Game { private string strName; public string Name { get { return strName; } set { strName = value; } } private string strCaption; public string Caption { get { return strCaption; } set { strCaption = value; } } private string strKey; public string Key { get { return strKey; } set { strKey - value; } } private int intCDTrayLocation; public int CDTrayLocation { get { return intCDTrayLocation; } set { intCDTrayLocation = value; } } public Game() { } public Game(string strName, string strCaption, string strKey, int intCDTrayLocation) { this.Name = strName; this.Caption = strCaption; this.Key = strKey; this.CDTrayLocation = intCDTrayLocation; } }
Next you need to create the class and then fill the object with data.
C# Syntax (Toggle Plain Text)
Game clssGame = new Game(); clssGame.Name = "Starcraft"; clssGame.Caption = "Cool game also cd need to be cleaned"; clssGame.Key = "5555-5555-5555-5555"; clssGame.CDTrayLocation = 22;
After that pass the object Game to the child window. Use some code like this to populate the child window on the load event.
C# Syntax (Toggle Plain Text)
txtbxName.Text = clssGame.Name; txtbxCaption.Text = clssGame.Caption;
Keep adding different textboxes or whatever control for each property.
Forgive my spelling, I spell code not English.
![]() |
Other Threads in the C# Forum
- Previous Thread: save GDI+ image into sql 2005 database
- Next Thread: Getting a C# program with a manifest file to run in the debugger
| Thread Tools | Search this Thread |
.net access algorithm alignment array barchart bitmap box broadcast buttons c# c#gridviewcolumn check checkbox client combobox communication control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing elevated encryption enum event excel file focus forloop form format forms function gdi+ hospitalmanagementsystem httpwebrequest image index input install java label list listbox localization login mandelbrot math messagebox mouseclick mysql operator path photoshop picturebox pixelinversion plotting pointer post programming radians read regex remote remoting richtextbox server sleep socket sql statistics stream string stringformatting sun table text textbox thread time timer update usercontrol validation visualstudio webbrowser whileloop windows winforms wpf xml





