Click here to Skip to main content
15,920,602 members
Home / Discussions / Windows Forms
   

Windows Forms

 
AnswerRe: Slow repaint of controls Pin
MrRobot17-Sep-07 0:28
MrRobot17-Sep-07 0:28 
QuestionToolstrip control Work like toolbox in vs2005 Pin
VB 8.013-Sep-07 20:33
VB 8.013-Sep-07 20:33 
QuestionImage Background in a RichTextBox Pin
Stige13-Sep-07 11:52
Stige13-Sep-07 11:52 
AnswerRe: Image Background in a RichTextBox Pin
DigiOz Multimedia16-Sep-07 12:49
DigiOz Multimedia16-Sep-07 12:49 
QuestionWebBrowser Control. Urgent. Pin
Elizma13-Sep-07 6:18
Elizma13-Sep-07 6:18 
AnswerRe: WebBrowser Control. Urgent. Pin
Paul Conrad26-Sep-07 16:18
professionalPaul Conrad26-Sep-07 16:18 
QuestionRunTime How to Set A Object Type Pin
M.Sathiskumar13-Sep-07 0:49
M.Sathiskumar13-Sep-07 0:49 
AnswerRe: RunTime How to Set A Object Type Pin
Lutosław17-Sep-07 4:40
Lutosław17-Sep-07 4:40 
In this specific situation use
C#
string value = "Yellow";
Color c = Color.FromKnownColor((KnownColor)Enum.Parse(typeof(KnownColor), value));

Generally, some type must be able create it's instance from a string. Assuming that it has a constructor which takes a string, you can use following code:
C#
//the code:
string type = "Temporary.MyType";
string value = "1,2,4";
// use the Reflection
MyType create = (MyType)Type.GetType(type).GetConstructor(new Type[] { typeof(string) })
	.Invoke(new object[] { value });
// the class:
namespace Temporary
{
	public class MyType  // sample class
	{
		int[] data;
		public MyType(string str)
		{
			string[] numbers = str.Split(',');
			data = new int[numbers.Length];
			for (int i = 0; i < data.Length; i++) {
				data[i] = int.Parse(numbers[i]);
			}
		}
		public int[] Data
		{
			get { return data; }
		}
	}
}


Greetings - Gajatko

Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.

QuestionUser Control with container area? [modified] Pin
MrBean12-Sep-07 23:23
MrBean12-Sep-07 23:23 
AnswerRe: User Control with container area? Pin
Lutosław13-Sep-07 7:13
Lutosław13-Sep-07 7:13 
GeneralRe: User Control with container area? Pin
MrBean13-Sep-07 21:19
MrBean13-Sep-07 21:19 
AnswerRe: User Control with container area? Pin
Patrick Etc.19-Sep-07 16:54
Patrick Etc.19-Sep-07 16:54 
GeneralRe: User Control with container area? Pin
MrBean19-Sep-07 23:22
MrBean19-Sep-07 23:22 
QuestionHow to show a calendar in wpf Pin
sarodam11-Sep-07 19:37
sarodam11-Sep-07 19:37 
QuestionNeed information on Form.resx files. Pin
Preston McCormick11-Sep-07 13:28
Preston McCormick11-Sep-07 13:28 
QuestionSimple question about button on windows forms Pin
maglev_tgv10-Sep-07 22:18
maglev_tgv10-Sep-07 22:18 
AnswerRe: Simple question about button on windows forms Pin
ChandraRam11-Sep-07 0:02
ChandraRam11-Sep-07 0:02 
GeneralRe: Simple question about button on windows forms Pin
Giorgi Dalakishvili11-Sep-07 0:05
mentorGiorgi Dalakishvili11-Sep-07 0:05 
AnswerRe: Simple question about button on windows forms Pin
Christian Graus11-Sep-07 0:03
protectorChristian Graus11-Sep-07 0:03 
GeneralRe: Simple question about button on windows forms Pin
Urs Enzler11-Sep-07 3:02
Urs Enzler11-Sep-07 3:02 
GeneralRe: Simple question about button on windows forms Pin
Giorgi Dalakishvili11-Sep-07 3:09
mentorGiorgi Dalakishvili11-Sep-07 3:09 
QuestionDatagrid ID value Automatic [modified] Pin
somagunasekaran10-Sep-07 3:29
somagunasekaran10-Sep-07 3:29 
QuestionHow to Delete the Datagrid Row Pin
somagunasekaran9-Sep-07 21:56
somagunasekaran9-Sep-07 21:56 
QuestionDataGrid control WinFroms Pin
somagunasekaran9-Sep-07 17:39
somagunasekaran9-Sep-07 17:39 
AnswerRe: DataGrid control WinFroms Pin
John_Adams30-Apr-08 22:45
John_Adams30-Apr-08 22:45 

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.