Share via

how to convert the string format to integer

denesh neupane 121 Reputation points
Jun 22, 2022, 12:27 AM

if the color of textbox is white then the textbox text is 0xffffff
how can i used it as a integer

Color myColor = textBox26.BackColor;
int nColorWin32 = ColorTranslator.ToWin32(myColor);
textBox26.Text = "0x" + string.Format("{0:X6}", nColorWin32);

int value;
Int32.TryParse(textBox26.Text, out value);
//i need to change the color of graph according to the textbox color
layer.addDataSet(darray, value);

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,103 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,338 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 87,806 Reputation points
    Jun 22, 2022, 1:05 AM

    You can do :

    int value = Convert.ToInt32(textBox26.Text, 16);  
    

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.