.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Resizing and hiding a TableLayoutPanel

Posted By:      Posted Date: September 15, 2010    Points: 0   Category :Windows Application
I have 3 TableLayoutPanels 1-OuterPanel and 2-InnerPanels: iPanel_1(inner bigger panel) and iPanel_2 (smaller).   What I want is: When user presses some button, the iPanel_2 should hide and iPanel_1 (with all the control it contains with Dock=fill option) should overshadow the display part which was owned previously by iPanel_2.   private void btnMainView_Click(object sender, EventArgs e) { Size oldSz_iPanel_1 = new Size(iPanel_1.Width, iPanel_1.Height); Size newSz_iPanel_1 = new Size(iPanel_1.Width, iPanel_1.Height + iPanel_2.Height);   //This will hide the innerPanel-2 HidePanelRowColumn(iPanel_2, 0, 0, false);   //This code should actually resize the iPanel_1 to overshadow iPanel_2. iPanel_1.Size = newSz_iPanel_1; }   protected void HidePanelRowColumn(TableLayoutPanel panel, int colIndex, int rowIndex, bool visibility) { panel.GetControlFromPosition(colIndex, rowIndex).Visible = visibility; }   Even when I assign: iPanel_1.Size = newSz_iPanel_1,  the Size of iPanel_1 remains as it was.   <Note> iPanel_1.AutoSize = true; iPanel_2.AutoSize = true;   Am I missing something?

View Complete Post

More Related Resource Links

How to position one control relative to another one even after resizing windows?


I used following Jquery code trying to make image close to a table. It worked fine after first load, but the position changed after window is resized. Any ideas? thanks

$(document).ready(function() {
            var pos = $("#mytable").offset();
            var width = $("#mytable").width();
            var left = pos.left + width + 20;
            var top = pos.top + 200;
                position: 'absolute',
                zIndex: 5000,
                left: left,
                top: top

OutOfMemory when resizing image


I've been pulling my hair out on this one. I have a image gallery module in asp.net. I'm using Telerik RadUpload to upload a sinlge image. I then save the image on the server and create a thumbnail and save it as well. There is no loop involved and is one at a time. It always seems to work when I run it locally on Windows 7 (IIS7) but on the server IIS6 I keep getting OutOfMemory errors. The images I'm trying are barely 1MB so not huge files. I've gone through google and bing over past several days and can't seem to find a solution. In my resize methods I'm using the "using" statement on the image reference, etc. I can pretty much always make it fail with the 3rd line below:

ruPhoto.UploadedFiles[0].SaveAs(Server.MapPath("~/DesktopModules/Gallery2/Photos/" + newPhotoName));
System.Drawing.Image photo = System.Drawing.Bitmap.FromFile(Server.MapPath("~/DesktopModules/Gallery2/Photos/" + newPhotoName));
//System.Drawing.Image img = new System.Drawing.Bitmap(photo); <--- will cause outofmemory error

if I just use the photo variable then the OutOfMemory will occur later in the resize code.

Any help would be greatly appreciated.

Hiding url


 I have a folder where documents are stored and a user can access these documents based on thier role.  The page come up www.name.com/folder/documentName.pdf


How can I get the url to display www.name.com/folder ?

Calendar hiding the last item in a day


Has anyone run into this? We have a calendar that, only on the 8th and 9th of the month, fails to show the last item:

It shows the hyperlink for "1 more item", but when you click it, it remains at "1 more item", rather than changing to "collapse". After verifying, there is one more item in the list that isnt getting displayed.


DIV hiding


I have two div's in my website i want to hide one dive on a button click using javascript

Hiding other month dates in ASP .Net Calendar Control

Often we need ASP .Net calendar control in our webpages. Most of the times we require navigation in between dates of the calendar control but there can be a requirement that when we want that users should not be able to select dates from month other than the current month.Some people might be thinking in mind that Microsoft has provided theShowNextPrevMonth property of a calendar control which can be set to false in order to disable the navigation in between months. Ok, this will disable navigation but what about the dates of adjacent months shown in current month?Following is the output of a normal Calendar control when ShowNextPrevMonth is not set to false.Note the red circles in above image. July and September will allow you to navigate through other months and red circles below will allow you to select dates of adjacent months.Ok now we set the ShowNextPrevMonth property to false and see the output. Following is the output in this case.So setting out the ShowNextPrevMonth property has disabled the July and Septemberlinks but dates of adjacent months are still there which can be selected as well. How to disable/hide these? Unfortunately there is no such default property provided using which one can disable or hide these dates but fortunately doing this using code is not a complex task. Use following code a

Hiding and showing the columns depends upon the filter condition

H,   We developed around 70 ssrs reports for our new application.Its like,all the report names are menrioned in the left hand side and if we click it,.Net calls the SSRS reports and shows the filters in the top of Right hand side.   We will select some filters there and then 'GO', it will fetch records. The issue now is, assume we have 6 columns in the report and depends upon the selection in the filter area, the columns should vanish.is it possible?

Hiding Upload Menu

  Hi All, Welcome to SharePoint Products & Techonologies. How to hide the UPLOAD menu in all the document libraries when the user is at 1st level and 2nd level of the folders in the doc library? Let me know if you have any queries. Thanks & Regards, Kumar.

When hiding in System Tray?

Why  when i hide my program in the system tray it does nothing there, i does only execute the code when i reopen it. is there some code to write for this Thanks.

SSRS column hiding

Hi    In My SSRS matrix report i have  3 dimension columns  'Branch','City','Location'  and one measure column 'Sales'   I have set the city column visible by 'Branch' and Location visiblity toggle by 'City'   But there is an issue found is if on loading the report for first time only branch is visible , But the report is taking the space for  City and Location -it is not visible although    Is there any way to completely hide the column in matrix report >>  we can hide the measure columns of course , but i want to hide the Dimenion columns    Regards  Sooraj

Problem displaying a page using window.showModalDialog when resizing it.

 Hi, I have a page that is displayed using window.showModalDialog, when the page is resized the tables, text boxes and everything else that is in the page with the width 100% doesn't resize (fit the page) unless a post back is used.How can I make the page keep everything in proportion when it is resized without the need to post back? 

tableLayoutPanel to DataTable

Hi. I am kind of stuck. I am using a tableLayoutPanel with a bunch of labels in them, to get a table-like display of text values. I would like to Export this tableLayoutPanel and all it's contents to a Word Document, but don't know if it is possible to do so. Is there then a way to create a DataTable and put the contents of the tableLayoutPanel in the DataTable in order to export it to a Word Document?? Using: Window Forms App, Visual Studio 2008, C#

Expandable ContentControl resizing issue

Hi , I am having a list of expanders.. inside those expanders there are  some forms On expand and collapse i am showing animation like we have in accordian... For the animation i have made use of ExpandableCOntentControl... Every thing works fine.. Only there is one issue.. Some of the forms have add function whihc will add some controls in the UI.. But when the controls are addded my expander doesnot stretch  and as a  result my controls get cut.... But when i  collapse and expand again my expander then i am able to see all the ocntrols properly.. Please help me in this...          

hiding hyperlink in url when its navigateurl is null

Hi Friends, I have a hyperlink control on my datalist. The navigate url property is bound to a field called "AttachFile" in my datatable. Is there a way I can make the hyperlink control invisible if the field it's bound to is null or blank? Thanks in Advance, Sepid 

TabControl Hiding the Tab Header

I have a requirement which says that I can have one or multiple tabs. If I have only tab I have to hide the tab header. I know there is no standard way of doing this so wondering if someone has figured out some special way of doing this or knows how this can be achieved. Thanks in advance Shams
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend