Thebattlefront Posted July 29, 2023 Report Share Posted July 29, 2023 (edited) Hi, I was wondering if there was a way to convert a string into a PBShape variable. For example, if we had: string ShapeValue = "Star"; ShapeValue.ToPBShape(); would make ShapeValue change from string "Star" to PBShape.Star. And I could use that variable for printing purposes. Edited July 29, 2023 by Thebattlefront Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted July 29, 2023 Report Share Posted July 29, 2023 PBShape shape = PBShape.A; string ShapeString = "Square"; Enum.TryParse(ShapeString, out shape); Quote Link to comment Share on other sites More sharing options...
Thebattlefront Posted July 29, 2023 Author Report Share Posted July 29, 2023 Thank you Mike! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.