Click here to Skip to main content
15,900,906 members
Home / Discussions / C#
   

C#

 
AnswerRe: graph not drawing properly? Pin
Luc Pattyn20-Sep-10 16:33
sitebuilderLuc Pattyn20-Sep-10 16:33 
Questionwhy they don't show up Pin
neverpleat20-Sep-10 14:50
neverpleat20-Sep-10 14:50 
AnswerRe: why they don't show up Pin
Luc Pattyn20-Sep-10 15:02
sitebuilderLuc Pattyn20-Sep-10 15:02 
GeneralRe: why they don't show up Pin
neverpleat20-Sep-10 15:20
neverpleat20-Sep-10 15:20 
GeneralRe: why they don't show up Pin
Luc Pattyn20-Sep-10 15:36
sitebuilderLuc Pattyn20-Sep-10 15:36 
GeneralRe: why they don't show up [modified] Pin
neverpleat20-Sep-10 17:17
neverpleat20-Sep-10 17:17 
AnswerRe: why they don't show up Pin
Abhinav S20-Sep-10 18:17
Abhinav S20-Sep-10 18:17 
AnswerRe: why they don't show up Pin
phil.o21-Sep-10 0:08
professionalphil.o21-Sep-10 0:08 
Try to get rid of your Application.DoEvent() first.
It's better to surround the creation of your controls by SuspendLayout()/ResumeLayout().

panel4.Controls.Clear();
int i = 0;
int left = 9;
waarb = @"Comm\ConnMgr";
RegKey = Registry.LocalMachine.OpenSubKey(waarb);

if (RegKey != null)
{
   Button dynamicButton = null;
   this.SuspendLayout();
   foreach (string valuename in RegKey.GetSubKeyNames()) 
   {
      dynamicButton = new Button();
      dynamicButton.Name = "dynamicButton" + i.ToString();
      dynamicButton.Width = 75;
      dynamicButton.Height = 23;
      dynamicButton.Left = left;
      dynamicButton.Top = 10 + (dynamicButton.Height + 10) * i;
      dynamicButton.Text = valuename.ToString();
      dynamicButton.Click += new EventHandler(Button_Click); //hook the Click event
      panel4.Controls.Add(dynamicButton);
      i++;
   }
   this.ResumeLayout();
   RegKey.Flush();
   RegKey.Close();
}


Then debug your application :

Put a spy on the panel4 object.
See the Controls property of panel4. What's in there ? Does the Count property seem correct (i.e. it has the same as the number of keys in the registry).
Then put a beakpoint in your loop. For each button created, check its properties ; maybe there's one you didn't think of and that has to be set.
Questionwhere to manage my picture box control Pin
Member 745530620-Sep-10 10:53
Member 745530620-Sep-10 10:53 
AnswerRe: where to manage my picture box control [modified] Pin
Luc Pattyn20-Sep-10 11:38
sitebuilderLuc Pattyn20-Sep-10 11:38 
QuestionWPF Database Wrapping Pin
eddieangel20-Sep-10 6:25
eddieangel20-Sep-10 6:25 
AnswerRe: WPF Database Wrapping Pin
Chris Trelawny-Ross20-Sep-10 9:19
Chris Trelawny-Ross20-Sep-10 9:19 
GeneralRe: WPF Database Wrapping Pin
eddieangel20-Sep-10 10:49
eddieangel20-Sep-10 10:49 
AnswerRe: WPF Database Wrapping Pin
Patrick Fox20-Sep-10 9:24
Patrick Fox20-Sep-10 9:24 
QuestionA question on SOAP and web services Pin
Dewald20-Sep-10 4:04
Dewald20-Sep-10 4:04 
AnswerRe: A question on SOAP and web services Pin
Pete O'Hanlon20-Sep-10 4:54
mvePete O'Hanlon20-Sep-10 4:54 
AnswerRe: A question on SOAP and web services Pin
T M Gray20-Sep-10 11:47
T M Gray20-Sep-10 11:47 
QuestionHow to find all the rectangle in point collection ? Pin
Yanshof20-Sep-10 2:50
Yanshof20-Sep-10 2:50 
AnswerRe: How to find all the rectangle in point collection ? Pin
DaveyM6920-Sep-10 4:07
professionalDaveyM6920-Sep-10 4:07 
Questionprocess.start and sc delete servicename Pin
tomorrow_ft20-Sep-10 0:53
tomorrow_ft20-Sep-10 0:53 
AnswerRe: process.start and sc delete servicename Pin
tomorrow_ft20-Sep-10 1:06
tomorrow_ft20-Sep-10 1:06 
AnswerRe: process.start and sc delete servicename Pin
Pete O'Hanlon20-Sep-10 1:09
mvePete O'Hanlon20-Sep-10 1:09 
QuestionC# Seeing Through Objects Pin
C.CoderCreator19-Sep-10 20:49
C.CoderCreator19-Sep-10 20:49 
AnswerRe: C# Seeing Through Objects Pin
#realJSOP19-Sep-10 23:44
professional#realJSOP19-Sep-10 23:44 
GeneralRe: C# Seeing Through Objects Pin
C.CoderCreator19-Sep-10 23:58
C.CoderCreator19-Sep-10 23:58 

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.