Click here to Skip to main content
15,918,967 members
Home / Discussions / C#
   

C#

 
GeneralXML Loading Problem Pin
Nick Parker22-May-03 17:29
protectorNick Parker22-May-03 17:29 
GeneralRe: XML Loading Problem Pin
Philip Fitzsimons23-May-03 2:55
Philip Fitzsimons23-May-03 2:55 
GeneralRe: XML Loading Problem Pin
Nick Parker23-May-03 5:21
protectorNick Parker23-May-03 5:21 
GeneralRe: XML Loading Problem Pin
cdehelean23-May-03 2:56
cdehelean23-May-03 2:56 
GeneralQuestion About Sockets Pin
jtmtv1822-May-03 16:04
jtmtv1822-May-03 16:04 
GeneralRe: Question About Sockets Pin
Burt Harris23-May-03 18:44
Burt Harris23-May-03 18:44 
GeneralRe: Question About Sockets Pin
jtmtv1823-May-03 20:28
jtmtv1823-May-03 20:28 
GeneralNetscape / Winamp / SAPrefs Style options dialog Pin
dazinith22-May-03 11:23
dazinith22-May-03 11:23 
hi everyone.. im working on a dialog that is very similar to this article written in C++
http://www.codeproject.com/property/saprefs.asp?target=saprefs[^]

i actually have the whole thing working except one small minor glitch that i cant figure out.. i will be posting an article and provide the dialog as freeware, but i need to fix this glitch first..

basicly when you click on the tree on the left i call this function:
private void tvOptionsTree_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
{
	Form frmSelected = GetSelectedForm();
	if (frmSelected == null)
	{	MessageBox.Show("An error has occured in the options form which should never occur!\r\ntvOptionsTree_AfterSelect()");
		return;	}

	ShowForm(frmSelected);
}
which in turn calls this:
private void ShowForm(Form frmForm)
{
	this.SuspendLayout();

	// if there is a form currently displayed we must get rid of it
	if (this.m_frmShownForm != null)
	{	this.m_frmShownForm.Enabled = false;
		this.m_frmShownForm.Visible = false;
		this.RemoveOwnedForm(m_frmShownForm);}

	m_frmShownForm = frmForm;
	
	m_frmShownForm.Location = new Point(this.PointToScreen(new Point(0, 0)).X + panel1.Left, 
		this.PointToScreen(new Point(0, 0)).Y + panel1.Top);

	m_frmShownForm.Size = panel1.Size;
	m_frmShownForm.FormBorderStyle = FormBorderStyle.None;
	m_frmShownForm.ShowInTaskbar = false;
	m_frmShownForm.StartPosition = FormStartPosition.Manual;
	
	this.AddOwnedForm(m_frmShownForm);
	
	//this.ResumeLayout();
	m_frmShownForm.Enabled = true;
	m_frmShownForm.Visible = true;
	m_frmShownForm.BringToFront();
	m_frmShownForm.Select();
	m_frmShownForm.Focus();
	m_frmShownForm.Refresh();
}
as you can see i put the new form to the front, set it as the focus, enable it, make it visible.. almost everything i can think of.. and it works great.. but..

when the form loads it calls the form load event which in turn calls the tvOptionsTree_AfterSelect function as listed above.. which in turn calls the ShowForm() as listed above.. but i cant click in any of the fields on the dialog on the right hand side which it displayed.. i cant click in a checkbox, i dont get an 'i-beam' when i put the cursor over the textboxes, etc.. as soon as i choose another item in the tree it works.. go back to the starting page and it works.. the whole thing works great after you change the selection on the tree the first time..

ive tried calling tvOptionsTree_AfterSelect multiple times in my form load message handler.. but that doesnt help.. obviously there is something im doing wrong.. the other thing is that when a control in the panel has focus it turns the title bar of the dialog gray, like another dialog has focus.. also my tab order wont go from the main dialog to the subdialog and back and forth.. it cycles through them as seperate dialogs depending on which one has focus.. any suggestions would be much appreciated.. im sure this dialog would help alot of ppl.. i know because the CSAPrefs on CP helped me a bunch in the past..

btw.. i also had to implement moving the subdialog with the options dialog in the options dialog LocationChanged event.. shouldn't it automatically move any child windows when the parent moves? or is it normal to have to override this?

thanks for any and all suggestions!

still a newb.. cut me some slack :P
-dz
GeneralDateTimePicker and TextBox Formatting - C# Windows Forms Pin
sajecw22-May-03 8:07
sajecw22-May-03 8:07 
GeneralDataGrid - C# Windows Forms - How to not Allow a 'new' record added to end of grid Pin
sajecw22-May-03 7:59
sajecw22-May-03 7:59 
GeneralRe: DataGrid - C# Windows Forms - How to not Allow a 'new' record added to end of grid Pin
Jose Fco Bonnin22-May-03 21:26
Jose Fco Bonnin22-May-03 21:26 
GeneralRe: DataGrid - C# Windows Forms - How to not Allow a 'new' record added to end of grid Pin
sajecw23-May-03 5:32
sajecw23-May-03 5:32 
GeneralContext-sensitive Help Pin
LongRange.Shooter22-May-03 7:58
LongRange.Shooter22-May-03 7:58 
QuestionPerformance counter bug? Pin
solidstore22-May-03 7:51
solidstore22-May-03 7:51 
Generalcustom sections in .config files Pin
Anonymous22-May-03 6:43
Anonymous22-May-03 6:43 
GeneralRe: custom sections in .config files Pin
Anonymous22-May-03 6:45
Anonymous22-May-03 6:45 
GeneralRe: custom sections in .config files Pin
Anonymous22-May-03 6:48
Anonymous22-May-03 6:48 
GeneralRe: custom sections in .config files Pin
The Limey22-May-03 16:54
The Limey22-May-03 16:54 
GeneralRe: custom sections in .config files Pin
The Limey22-May-03 16:56
The Limey22-May-03 16:56 
QuestionOwner Drawn Menu item -- Matching Font? Pin
KingTermite22-May-03 6:20
KingTermite22-May-03 6:20 
AnswerRe: Owner Drawn Menu item -- Matching Font? Pin
KingTermite22-May-03 16:06
KingTermite22-May-03 16:06 
Generalsetting up path for c# Pin
Slow Learner22-May-03 4:44
Slow Learner22-May-03 4:44 
GeneralRe: setting up path for c# Pin
Daniel Turini22-May-03 5:04
Daniel Turini22-May-03 5:04 
GeneralRe: setting up path for c# Pin
Slow Learner23-May-03 9:08
Slow Learner23-May-03 9:08 
GeneralArray of Hashes Pin
JJF00722-May-03 3:48
JJF00722-May-03 3:48 

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.