Click here to Skip to main content
15,845,469 members
Home / Discussions / C#
   

C#

 
GeneralRe: c# code Pin
j k Nov202329-Nov-23 21:04
j k Nov202329-Nov-23 21:04 
AnswerRe: c# code Pin
jschell30-Nov-23 7:05
jschell30-Nov-23 7:05 
AnswerRe: c# code Pin
Andre Oosthuizen1-Dec-23 23:35
mveAndre Oosthuizen1-Dec-23 23:35 
GeneralRe: c# code Pin
j k Nov20232-Dec-23 21:34
j k Nov20232-Dec-23 21:34 
GeneralRe: c# code Pin
Andre Oosthuizen3-Dec-23 3:35
mveAndre Oosthuizen3-Dec-23 3:35 
QuestionConverting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
Codice Fictor26-Nov-23 13:19
Codice Fictor26-Nov-23 13:19 
AnswerRe: Converting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
Dave Kreskowiak26-Nov-23 15:07
mveDave Kreskowiak26-Nov-23 15:07 
GeneralRe: Converting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
Codice Fictor26-Nov-23 16:52
Codice Fictor26-Nov-23 16:52 
Hello Dave and Thank You very Much,
I understand and agree with you completely but I am taking an inverse approach due to my apps functionality. I am creating a SendKeys keyboard emulator which will have a pre compiled set of universal buttons all referenced by the simple button1-n name. I will have an excel config file with the button’s parameters (visibility, location, size, text, colors.... and key code) which will be loaded for each application I want to keyboard emulate. Instead of having to have multiple form layouts and keycodes for each interface application I will have a simple excel file to copy cut and paste parameters.
So from my excel config I can set number and string parameters but I can't store and retrieve object oriented parameters (def?), I have to store & retrieve them as strings.
The problem that hangs me up is when I have a parameter such as FlatStyle with has arguments of Standard, Flat, PopUp... that are not strings but some type of object property. So when I need to retrieve PopUp as a string I need to convert it to a type of object property.

var TypeOfStyleObject = convert-this-string-to-what-FlatStyle-wants("PopUp"); // PopUp will actually be a StringArray[x]
button1.FlatStyle = TypeOfStyleObject;

I studied the link you pointed out and it solved my problem, with an exception. I fetched the name of the CONTROL (not a specific control like Button) and changed my function input from BUTTON to CONTROL. It passed without error but I did find a catch....

In the function that I apply the configuration parameters to the generic buttons I successfully applied Text, BackColor, ForeColor as a quick test. When I was passing the Button control I was setting FlatStyle but getting a string to object error (above). Now that I am passing the Control control it is saying my "Control" does not have a parameter FlatStyle. I am interpreting this way..... the Control lets me work without specifying the type of object(button, label, RTBox) but I may lose access to some parameters??? Accurate??
I may need to still find a way of passing specific controls instead of generic control object so I don’t lose configurability. I could follow your lead of preloading a Button[] object array and trying see if I can use its index as an object.

Am going anywhere but backwards or circles…… I assuming there has to be some methods that allows you to convert-this-string-to-what-AnyObject-wants() so objects can be acted on in loops and sequences. You have to be able to store & retrieve non numeric config info (strings) that represent object.string.parameterss!!!!! read them & convert to string, save, retrieve, convert string back to object.

Thank You Again………….
GeneralRe: Converting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
Richard MacCutchan26-Nov-23 22:28
mveRichard MacCutchan26-Nov-23 22:28 
GeneralRe: Converting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
Gerry Schmitz26-Nov-23 22:45
mveGerry Schmitz26-Nov-23 22:45 
GeneralRe: Converting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
Codice Fictor27-Nov-23 5:08
Codice Fictor27-Nov-23 5:08 
GeneralRe: Converting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
Gerry Schmitz27-Nov-23 6:54
mveGerry Schmitz27-Nov-23 6:54 
GeneralRe: Converting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
Codice Fictor27-Nov-23 7:47
Codice Fictor27-Nov-23 7:47 
GeneralRe: Converting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
Gerry Schmitz27-Nov-23 8:07
mveGerry Schmitz27-Nov-23 8:07 
QuestionRe: Converting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
Eddy Vluggen27-Nov-23 8:46
professionalEddy Vluggen27-Nov-23 8:46 
AnswerRe: Converting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
Gerry Schmitz27-Nov-23 16:48
mveGerry Schmitz27-Nov-23 16:48 
GeneralRe: Converting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
Eddy Vluggen28-Nov-23 1:42
professionalEddy Vluggen28-Nov-23 1:42 
GeneralRe: Converting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
Pete O'Hanlon28-Nov-23 1:48
subeditorPete O'Hanlon28-Nov-23 1:48 
GeneralRe: Converting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
Eddy Vluggen28-Nov-23 2:02
professionalEddy Vluggen28-Nov-23 2:02 
GeneralRe: Converting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
Gerry Schmitz28-Nov-23 7:11
mveGerry Schmitz28-Nov-23 7:11 
AnswerRe: Converting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
jschell27-Nov-23 7:14
jschell27-Nov-23 7:14 
GeneralRe: Converting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
Codice Fictor27-Nov-23 12:12
Codice Fictor27-Nov-23 12:12 
GeneralRe: Converting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
Gerry Schmitz27-Nov-23 17:00
mveGerry Schmitz27-Nov-23 17:00 
GeneralRe: Converting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
Codice Fictor28-Nov-23 19:28
Codice Fictor28-Nov-23 19:28 
GeneralRe: Converting string into non-string Form.Object types for passing to methods or updating non-string object.Property with strings Pin
jschell29-Nov-23 5:56
jschell29-Nov-23 5:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.