Windows Forms Controls

Posted April 11, 2003

Chat Date: March 11, 2003

Please note: Portions of this transcript have been edited for clarity

Chat Participants:

  • Seth Grossman, a technical writer with the Windows Forms team
  • Scott Berry, another tester on the Windows Forms team
  • Kevin, a tester on the Windows Forms team
  • Mark Boulter a PM on the Windows Forms team
  • Ed Hickey, VB Communities PM

Moderator: Ed (Microsoft)
Welcome to today’s chat on Windows Forms Controls. We have members of the Windows Forms development team here to answer your questions today. I will ask the hosts to introduce themselves.

Host: Seth (Microsoft)
I'm Seth Grossman, a technical writer with the Windows Forms team.

Host: Kevin (Microsoft)
Hi I'm Kevin, a tester on the Windows Forms team.

Host: Mark B (Microsoft)
Hi I'm Mark Boulter a PM on the Windows Forms team.....

Host: Scott (Microsoft)
I'm Scott Berry, another tester on the Windows Forms team.

Moderator: Ed (Microsoft)
And I am Ed Hickey, VB Communities PM. Glad you all could make it today!

Moderator: Ed (Microsoft)
Let's get started! Fire away with your questions for our hosts.

Host: Mark B (Microsoft)
Q: My question is this, is there a way to get this not to make a .dll

A: No you have to make an assembly. You can use the ReflectionEmit API but this is significantly more work

Host: Scott (Microsoft)
Q: I am experiencing problems when checking in and out due to my datasets row is not matching up with my hti.Row in my Datagrid (hit test was done).

A: When you bind, you're actually seeing the table's DefaultView (which can be filtered and sorted), not the Rows from the table Instead of trying to get ds.Tables[0].Rows[i], try ds.Tables[0].DefaultView[i].

Host: Mark B (Microsoft)
Q: I use the control.font.tostring to save the info and I then have the function to set the font of my dynamic control, is there an easier way to save the font's design and set the design?

A: Use the FontConverter class: TypeConverter typeConverter = TypeDescriptor.GetConverter(typeof(Font)); if (typeConverter != null && typeConverter.CanConvertTo(typeof(String))) { string s = typeConverter.ConvertTo(s);

Host: Mark B (Microsoft)
Bother try again:

Host: Mark B (Microsoft)
TypeConverter typeConverter = TypeDescriptor.GetConverter(typeof(Font));

Host: Mark B (Microsoft)
if (typeConverter != null && typeConverter.CanConvertTo(typeof(String))) {

Host: Mark B (Microsoft)
string s = typeConverter.ConvertTo( s );

Host: Mark B (Microsoft)
}

Host: Mark B (Microsoft)
And for the reverse use CanConvertFrom & ConvertFrom

Host: Kevin (Microsoft)
Q: Are you able to use an object (e.g., PictureControl) as a parent to an MDI child window, rather than a form?

A: No, a form is the only valid host for an MDI child form.

Host: Seth (Microsoft)
Q: Ok another question. when using the color dialog control, is there a way for it to show the same color dialog you get in the IDE

A: The short answer is no. :) The longer answer is that the one in the IDE is a UI Type Editor and while you could conceivably implement it in a dialog, it is non-trivial, and it'd probably be more worth your while to create your own dialog with tabs for the colors.

Host: Mark B (Microsoft)
Q: I'm using a process and it opens a command window to run this commandline utiliity. I have tried everything to not show that window I have set the process to be minimized and other things but it keeps showing up.

A: On Process set UseShellExecute=false & CreateNoWindow=true

Host: Mark B (Microsoft)
Process child = new Process(); child.StartInfo.FileName = "c:\\Program Files\\Microsoft Visual Studio .NET\\FrameworkSDK\\bin\\gacutil.exe"; child.StartInfo.Arguments = "/ldl"; child.StartInfo.UseShellExecute = false; child.Start

Host: Mark B (Microsoft)
child.StartInfo.CreateNoWindow = true; child.StartInfo.RedirectStandardOutput = true; child.StartInfo.RedirectStandardError = true; child.StartInfo.RedirectStandardInput = true; child.Start(); string output = null; int count = 0 ;

Host: Mark B (Microsoft)
TextWriter completeoutput = new StringWriter(); do { output = child.StandardOutput.ReadLine(); if (output != null && output.Length > 0 && count > 4) { completeoutput.WriteLine(output); } count++;

Host: Mark B (Microsoft)
} while (output != null); richTextBox1.Text = completeoutput.ToString();

Host: Scott (Microsoft)
Q: Can someone please suggest a good book about using windows forms?

A: Check out https://windowsforms.net, which has a list of books on the bottom right of the page.

Host: Mark B (Microsoft)
Bye for now - mark

Moderator: Ed (Microsoft)
Thank you to everyone. Unfortunately, it is time to go. Thanks for participating, and we'll see you next time!

Host: Seth (Microsoft)
Thanks!

For further information on this topic please visit the following:

Newsgroups: microsoft.public.dotnet.languages.vb

VB .NET Transcripts: Read the archive of past VB .NET chats.

Website: Visit the Microsoft Visual Basic .NET site.

Top of PageTop of Page