Click here to Skip to main content
15,899,003 members
Home / Discussions / C#
   

C#

 
GeneralAbout case assembly version lessoned Pin
pig12348-Jun-04 16:11
pig12348-Jun-04 16:11 
GeneralRe: About case assembly version lessoned Pin
Heath Stewart8-Jun-04 17:32
protectorHeath Stewart8-Jun-04 17:32 
GeneralRe: About case assembly version lessoned Pin
pig12348-Jun-04 19:29
pig12348-Jun-04 19:29 
QuestionProject report generation using GDI+ ? Pin
sachinkalse8-Jun-04 14:48
sachinkalse8-Jun-04 14:48 
AnswerRe: Project report generation using GDI+ ? Pin
Heath Stewart8-Jun-04 17:43
protectorHeath Stewart8-Jun-04 17:43 
QuestionHow do i programatically restart the current website or appdomain Pin
kris.mackintosh8-Jun-04 12:33
kris.mackintosh8-Jun-04 12:33 
AnswerRe: How do i programatically restart the current website or appdomain Pin
Heath Stewart8-Jun-04 17:38
protectorHeath Stewart8-Jun-04 17:38 
GeneralHelp with Windows services Pin
quilkin8-Jun-04 11:58
quilkin8-Jun-04 11:58 
GeneralRe: Help with Windows services Pin
Heath Stewart8-Jun-04 12:21
protectorHeath Stewart8-Jun-04 12:21 
GeneralRe: Help with Windows services Pin
quilkin9-Jun-04 2:20
quilkin9-Jun-04 2:20 
GeneralRe: Help with Windows services Pin
quilkin9-Jun-04 5:49
quilkin9-Jun-04 5:49 
GeneralListbox not refreshing. Pin
shadow_nubcake8-Jun-04 11:28
shadow_nubcake8-Jun-04 11:28 
Generalevent not picked up by form Pin
RomanD8-Jun-04 10:16
RomanD8-Jun-04 10:16 
GeneralRe: event not picked up by form Pin
Heath Stewart8-Jun-04 11:35
protectorHeath Stewart8-Jun-04 11:35 
GeneralRe: event not picked up by form Pin
RomanD8-Jun-04 12:09
RomanD8-Jun-04 12:09 
QuestionHow do I lock and Unlock files Pin
silverbullet8-Jun-04 8:32
silverbullet8-Jun-04 8:32 
AnswerRe: How do I lock and Unlock files Pin
Heath Stewart8-Jun-04 8:43
protectorHeath Stewart8-Jun-04 8:43 
GeneralTreeView context Menu C# Windows Forms Pin
OMalleyW8-Jun-04 8:27
OMalleyW8-Jun-04 8:27 
GeneralRe: TreeView context Menu C# Windows Forms Pin
bneacetp8-Jun-04 15:42
bneacetp8-Jun-04 15:42 
GeneralListView Scrollbars disappear Pin
Guinness4Strength8-Jun-04 7:59
Guinness4Strength8-Jun-04 7:59 
GeneralRe: ListView Scrollbars disappear Pin
Guinness4Strength8-Jun-04 10:35
Guinness4Strength8-Jun-04 10:35 
GeneralRe: ListView Scrollbars disappear Pin
Heath Stewart8-Jun-04 11:29
protectorHeath Stewart8-Jun-04 11:29 
GeneralRe: ListView Scrollbars disappear Pin
Guinness4Strength9-Jun-04 5:03
Guinness4Strength9-Jun-04 5:03 
I've tried this and I don't think its the answer:
protected override void OnLocationChanged(EventArgs e)
{
	if(!SettingLocation)
	{
		//relocate Favorites window
		if(frmFav!=null && frmFav.Visible)
		{
			//set relocate timer
			timFavMover.Enabled=true;
			MoveIdle=0;
		}
		IdleTime=0;
		SetPlayListHeight();
	}
	base.OnLocationChanged (e);
}
private void SetPlayListHeight()
{
	try
	{
		if(lvPlayList.Items.Count==0)
			return;
		SettingLocation=true;
		ListViewItem LastItem = lvPlayList.Items[lvPlayList.Items.Count-1];
		Rectangle ItemRect = LastItem.GetBounds(ItemBoundsPortion.Entire);
		//position window
		Screen CurScreen = Screen.PrimaryScreen;
		Rectangle Desktop = CurScreen.WorkingArea;
		if(this.Bottom > Desktop.Bottom)
		{
			//shrink playlist
			if(this.Height <= PlayerRect.Height)
			{
				this.Height=PlayerRect.Height;
				return;
			}
			while(this.Bottom > Desktop.Bottom)
			{
				int BottomDiff = this.Bottom-Desktop.Bottom;
				if(BottomDiff==0)
					break;
				this.Height-= BottomDiff;
				if(this.Height <= PlayerRect.Height)
					break;
			}
		}
		else if(!IsItemVisible(LastItem) && this.Bottom < Desktop.Bottom)
		{
			while(!IsItemVisible(LastItem) && this.Bottom < Desktop.Bottom)
			{
				int BottomDiff=Desktop.Bottom-this.Bottom;
				if(BottomDiff==0)
					break;
				if(ItemRect.Height > BottomDiff)
					this.Height+=BottomDiff;
				else
					this.Height+=ItemRect.Height;
			}
		}
	}
	catch(Exception Err)
	{
		MessageBox.Show("SetPlayListHeight Error: "+Err.Message);
	}
	finally
	{
		//Application.DoEvents();
		SettingLocation=false;
	}

Correct me if I'm wrong but,
everytime I set the location or size of my form programatically a LocationChanged event is added to the queue, these messages then stack up until I release the mouse button and the form's message pump can process the messages in the queue.
I tried adding Application.DoEvents() in my finally block but that caused the form to not resize at all.
Any suggestions ?
GeneralLooping through all controls on a webform Pin
caheo8-Jun-04 7:29
caheo8-Jun-04 7:29 
GeneralRe: Looping through all controls on a webform Pin
Colin Angus Mackay8-Jun-04 7:50
Colin Angus Mackay8-Jun-04 7:50 

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.