Custom Form - Anchoring issue

Hello folks,
i were designed a simple form, and the anchoring goin' wrong...
on designer it's OK, but while running not,
i even tried following link example, replacing panel with inheritance version one, but it also didn't worked...
http://support.microsoft.com/kb/953934
my code are here:
using System.Windows.Forms;
using HassanFaghihi.Tools.InteropServices;
namespace HassanFaghihi.StatesInstitution.Forms.Templates.CartoonBlackAndWhite
public partial class ButtonForm : Form
public ButtonForm()
InitializeComponent();
namespace HassanFaghihi.StatesInstitution.Forms.Templates.CartoonBlackAndWhite
partial class ButtonForm
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
if (disposing && (components != null))
components.Dispose();
base.Dispose(disposing);
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
this.panelHeaderPadding = new ControlContainer();
this.panelHeader = new ControlContainer();
this.panelCloseButton = new ControlContainer();
this.panelMain = new ControlContainer();
this.panelButtonPlaceHolderPadding = new ControlContainer();
this.panelButtonPlaceHolder = new ControlContainer();
this.panelContentPlaceHolder = new ControlContainer();
this.panelHeaderPadding.SuspendLayout();
this.panelHeader.SuspendLayout();
this.panelMain.SuspendLayout();
this.panelButtonPlaceHolderPadding.SuspendLayout();
this.SuspendLayout();
// panelHeaderPadding
this.panelHeaderPadding.Controls.Add(this.panelHeader);
this.panelHeaderPadding.Dock = System.Windows.Forms.DockStyle.Top;
this.panelHeaderPadding.Location = new System.Drawing.Point(0, 0);
this.panelHeaderPadding.Name = "panelHeaderPadding";
this.panelHeaderPadding.Padding = new System.Windows.Forms.Padding(4, 4, 4, 0);
this.panelHeaderPadding.Size = new System.Drawing.Size(500, 34);
this.panelHeaderPadding.TabIndex = 0;
// panelHeader
this.panelHeader.BackColor = System.Drawing.Color.White;
this.panelHeader.Controls.Add(this.panelCloseButton);
this.panelHeader.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelHeader.Location = new System.Drawing.Point(4, 4);
this.panelHeader.Name = "panelHeader";
this.panelHeader.Size = new System.Drawing.Size(492, 30);
this.panelHeader.TabIndex = 0;
this.panelHeader.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel5_MouseDown);
// panelCloseButton
this.panelCloseButton.BackgroundImage = global::HassanFaghihi.StatesInstitution.Forms.Properties.Resources.close;
this.panelCloseButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.panelCloseButton.Dock = System.Windows.Forms.DockStyle.Right;
this.panelCloseButton.Location = new System.Drawing.Point(462, 0);
this.panelCloseButton.Name = "panelCloseButton";
this.panelCloseButton.Size = new System.Drawing.Size(30, 30);
this.panelCloseButton.TabIndex = 0;
this.panelCloseButton.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panel4_MouseClick);
// panelMain
this.panelMain.Controls.Add(this.panelContentPlaceHolder);
this.panelMain.Controls.Add(this.panelButtonPlaceHolderPadding);
this.panelMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelMain.Location = new System.Drawing.Point(0, 34);
this.panelMain.Name = "panelMain";
this.panelMain.Padding = new System.Windows.Forms.Padding(4);
this.panelMain.Size = new System.Drawing.Size(500, 266);
this.panelMain.TabIndex = 0;
// panelButtonPlaceHolderPadding
this.panelButtonPlaceHolderPadding.Controls.Add(this.panelButtonPlaceHolder);
this.panelButtonPlaceHolderPadding.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelButtonPlaceHolderPadding.Location = new System.Drawing.Point(4, 229);
this.panelButtonPlaceHolderPadding.Name = "panelButtonPlaceHolderPadding";
this.panelButtonPlaceHolderPadding.Padding = new System.Windows.Forms.Padding(0, 4, 0, 0);
this.panelButtonPlaceHolderPadding.Size = new System.Drawing.Size(492, 33);
this.panelButtonPlaceHolderPadding.TabIndex = 1;
// panelButtonPlaceHolder
this.panelButtonPlaceHolder.BackColor = System.Drawing.Color.White;
this.panelButtonPlaceHolder.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelButtonPlaceHolder.Location = new System.Drawing.Point(0, 4);
this.panelButtonPlaceHolder.Name = "panelButtonPlaceHolder";
this.panelButtonPlaceHolder.Size = new System.Drawing.Size(492, 29);
this.panelButtonPlaceHolder.TabIndex = 0;
// panelContentPlaceHolder
this.panelContentPlaceHolder.BackColor = System.Drawing.Color.White;
this.panelContentPlaceHolder.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelContentPlaceHolder.Location = new System.Drawing.Point(4, 4);
this.panelContentPlaceHolder.Name = "panelContentPlaceHolder";
this.panelContentPlaceHolder.Size = new System.Drawing.Size(492, 225);
this.panelContentPlaceHolder.TabIndex = 0;
// ButtonForm
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Black;
this.ClientSize = new System.Drawing.Size(500, 300);
this.Controls.Add(this.panelMain);
this.Controls.Add(this.panelHeaderPadding);
this.Font = new System.Drawing.Font("Tahoma", 8F);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "ButtonForm";
this.Text = "Form1";
this.panelHeaderPadding.ResumeLayout(false);
this.panelHeader.ResumeLayout(false);
this.panelMain.ResumeLayout(false);
this.panelButtonPlaceHolderPadding.ResumeLayout(false);
this.ResumeLayout(false);
#endregion
private ControlContainer panelHeaderPadding;
private ControlContainer panelCloseButton;
private ControlContainer panelMain;
protected internal ControlContainer panelHeader;
private ControlContainer panelButtonPlaceHolderPadding;
protected internal ControlContainer panelContentPlaceHolder;
protected internal ControlContainer panelButtonPlaceHolder;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using HassanFaghihi.StatesInstitution.BusinessTier.Factory;
using HassanFaghihi.StatesInstitution.BusinessTier.Model;
using HassanFaghihi.StatesInstitution.Forms.Templates.CartoonBlackAndWhite;
using HassanFaghihi.Tools.Extensions;
using NHibernate.Util;
namespace HassanFaghihi.StatesInstitution.Forms
public partial class FindOwner : ButtonForm
private readonly List<Owner> _owners;
public Owner SelectedOwner { get; set; }
public FindOwner()
try
_owners = new OwnerFactory().GetOwners();
catch (Exception ex)
MessageBox.Show(this,
"Cannot access data at this time, Please try again.\nError Message: {0}".FormatString(ex.Message),
"Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
InitializeComponent();
SelectedOwner = null;
public FindOwner(Owner owner) : this()
SelectedOwner = owner;
//TODO: Select Current Owner on GridView
private void FindOwner_Load(object sender, EventArgs e)
//IQueryable<Owner> owners = new OwnerFactory().GetOwnersQueryable();
gridOwners.DataSource = _owners.ToList();
private void btnSelect_Click(object sender, EventArgs e)
Guid id = (Guid) gridOwners.CurrentRow.Cells[@"OwnerId"].Value;
SelectedOwner = _owners.First(w => id.Equals(w.OwnerId));
Close();
private void btnCancel_Click(object sender, EventArgs e)
Close();
namespace HassanFaghihi.StatesInstitution.Forms
partial class FindOwner
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
if (disposing && (components != null))
components.Dispose();
base.Dispose(disposing);
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
Janus.Windows.GridEX.GridEXLayout gridOwners_DesignTimeLayout = new Janus.Windows.GridEX.GridEXLayout();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FindOwner));
this.gridOwners = new Janus.Windows.GridEX.GridEX();
this.btnSelect = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.panelContentPlaceHolder.SuspendLayout();
this.panelButtonPlaceHolder.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gridOwners)).BeginInit();
this.SuspendLayout();
// panelHeader
this.panelHeader.Size = new System.Drawing.Size(393, 30);
// panelContentPlaceHolder
this.panelContentPlaceHolder.Controls.Add(this.gridOwners);
this.panelContentPlaceHolder.Size = new System.Drawing.Size(393, 135);
// panelButtonPlaceHolder
this.panelButtonPlaceHolder.Controls.Add(this.btnCancel);
this.panelButtonPlaceHolder.Controls.Add(this.btnSelect);
this.panelButtonPlaceHolder.Size = new System.Drawing.Size(393, 29);
// gridOwners
this.gridOwners.AlternatingRowFormatStyle.BackColor = System.Drawing.Color.Gainsboro;
gridOwners_DesignTimeLayout.LayoutString = resources.GetString("gridOwners_DesignTimeLayout.LayoutString");
this.gridOwners.DesignTimeLayout = gridOwners_DesignTimeLayout;
this.gridOwners.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridOwners.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.gridOwners.GroupByBoxVisible = false;
this.gridOwners.Location = new System.Drawing.Point(0, 0);
this.gridOwners.Name = "gridOwners";
this.gridOwners.Office2007ColorScheme = Janus.Windows.GridEX.Office2007ColorScheme.Custom;
this.gridOwners.Office2007CustomColor = System.Drawing.Color.Black;
this.gridOwners.RowHeaderContent = Janus.Windows.GridEX.RowHeaderContent.RowIndex;
this.gridOwners.RowHeaders = Janus.Windows.GridEX.InheritableBoolean.True;
this.gridOwners.Size = new System.Drawing.Size(393, 135);
this.gridOwners.TabIndex = 0;
this.gridOwners.VisualStyle = Janus.Windows.GridEX.VisualStyle.Office2007;
// btnSelect
this.btnSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnSelect.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnSelect.Image = global::HassanFaghihi.StatesInstitution.Forms.Properties.Resources.green_ok_icon_16px;
this.btnSelect.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnSelect.Location = new System.Drawing.Point(315, 3);
this.btnSelect.Name = "btnSelect";
this.btnSelect.Size = new System.Drawing.Size(75, 23);
this.btnSelect.TabIndex = 1;
this.btnSelect.Text = "انتخاب";
this.btnSelect.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnSelect.UseVisualStyleBackColor = true;
this.btnSelect.Click += new System.EventHandler(this.btnSelect_Click);
// btnCancel
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Image = global::HassanFaghihi.StatesInstitution.Forms.Properties.Resources.red_cross_icon_16px;
this.btnCancel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnCancel.Location = new System.Drawing.Point(3, 3);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 2;
this.btnCancel.Text = "خروج";
this.btnCancel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
// FindOwner
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(401, 210);
this.Name = "FindOwner";
this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.Text = "FindOwner";
this.Load += new System.EventHandler(this.FindOwner_Load);
this.panelContentPlaceHolder.ResumeLayout(false);
this.panelButtonPlaceHolder.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gridOwners)).EndInit();
this.ResumeLayout(false);
#endregion
private Janus.Windows.GridEX.GridEX gridOwners;
private System.Windows.Forms.Button btnSelect;
private System.Windows.Forms.Button btnCancel;
and here is my custom panel, regarding the issue, noted by microsoft
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HassanFaghihi.StatesInstitution.Forms.Templates.CartoonBlackAndWhite
public class ControlContainer:Panel
protected override void OnSizeChanged(EventArgs e)
if (this.Handle != null)
this.BeginInvoke((MethodInvoker)delegate
base.OnSizeChanged(e);

Hi deadManN
I can see that you have panels within panels and this is causing the issue. I can also see that you're using the multi layer panels to give you borders.
I'm going to suggest that you modify the layout.
Here's what your original ButtonForm.Designer.cs looked like after some minor tweaks to get rid of errors:
using System.Drawing;
namespace HassanFaghihi.StatesInstitution.Forms.Templates.CartoonBlackAndWhite
partial class ButtonForm
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
if (disposing && (components != null))
components.Dispose();
base.Dispose(disposing);
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ButtonForm));
this.panelHeaderPadding = new WindowsFormsApplication1.ControlContainer();
this.panelHeader = new WindowsFormsApplication1.ControlContainer();
this.panelCloseButton = new WindowsFormsApplication1.ControlContainer();
this.panelMain = new WindowsFormsApplication1.ControlContainer();
this.panelContentPlaceHolder = new WindowsFormsApplication1.ControlContainer();
this.panelButtonPlaceHolderPadding = new WindowsFormsApplication1.ControlContainer();
this.panelButtonPlaceHolder = new WindowsFormsApplication1.ControlContainer();
this.panelHeaderPadding.SuspendLayout();
this.panelHeader.SuspendLayout();
this.panelMain.SuspendLayout();
this.panelButtonPlaceHolderPadding.SuspendLayout();
this.SuspendLayout();
// panelHeaderPadding
this.panelHeaderPadding.Controls.Add(this.panelHeader);
this.panelHeaderPadding.Dock = System.Windows.Forms.DockStyle.Top;
this.panelHeaderPadding.Location = new System.Drawing.Point(0, 0);
this.panelHeaderPadding.Name = "panelHeaderPadding";
this.panelHeaderPadding.Padding = new System.Windows.Forms.Padding(4, 4, 4, 0);
this.panelHeaderPadding.Size = new System.Drawing.Size(500, 34);
this.panelHeaderPadding.TabIndex = 0;
// panelHeader
this.panelHeader.BackColor = System.Drawing.Color.White;
this.panelHeader.Controls.Add(this.panelCloseButton);
this.panelHeader.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelHeader.Location = new System.Drawing.Point(4, 4);
this.panelHeader.Name = "panelHeader";
this.panelHeader.Size = new System.Drawing.Size(492, 30);
this.panelHeader.TabIndex = 0;
// panelCloseButton
this.panelCloseButton.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelCloseButton.BackgroundImage")));
this.panelCloseButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.panelCloseButton.Dock = System.Windows.Forms.DockStyle.Right;
this.panelCloseButton.Location = new System.Drawing.Point(462, 0);
this.panelCloseButton.Name = "panelCloseButton";
this.panelCloseButton.Size = new System.Drawing.Size(30, 30);
this.panelCloseButton.TabIndex = 0;
this.panelCloseButton.Click += new System.EventHandler(this.panelCloseButton_Click);
// panelMain
this.panelMain.Controls.Add(this.panelContentPlaceHolder);
this.panelMain.Controls.Add(this.panelButtonPlaceHolderPadding);
this.panelMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelMain.Location = new System.Drawing.Point(0, 34);
this.panelMain.Name = "panelMain";
this.panelMain.Padding = new System.Windows.Forms.Padding(4);
this.panelMain.Size = new System.Drawing.Size(500, 266);
this.panelMain.TabIndex = 0;
// panelContentPlaceHolder
this.panelContentPlaceHolder.BackColor = System.Drawing.Color.White;
this.panelContentPlaceHolder.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelContentPlaceHolder.Location = new System.Drawing.Point(4, 4);
this.panelContentPlaceHolder.Name = "panelContentPlaceHolder";
this.panelContentPlaceHolder.Size = new System.Drawing.Size(492, 225);
this.panelContentPlaceHolder.TabIndex = 0;
// panelButtonPlaceHolderPadding
this.panelButtonPlaceHolderPadding.Controls.Add(this.panelButtonPlaceHolder);
this.panelButtonPlaceHolderPadding.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelButtonPlaceHolderPadding.Location = new System.Drawing.Point(4, 229);
this.panelButtonPlaceHolderPadding.Name = "panelButtonPlaceHolderPadding";
this.panelButtonPlaceHolderPadding.Padding = new System.Windows.Forms.Padding(0, 4, 0, 0);
this.panelButtonPlaceHolderPadding.Size = new System.Drawing.Size(492, 33);
this.panelButtonPlaceHolderPadding.TabIndex = 1;
// panelButtonPlaceHolder
this.panelButtonPlaceHolder.BackColor = System.Drawing.Color.White;
this.panelButtonPlaceHolder.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelButtonPlaceHolder.Location = new System.Drawing.Point(0, 4);
this.panelButtonPlaceHolder.Name = "panelButtonPlaceHolder";
this.panelButtonPlaceHolder.Size = new System.Drawing.Size(492, 29);
this.panelButtonPlaceHolder.TabIndex = 0;
// ButtonForm
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Black;
this.ClientSize = new System.Drawing.Size(500, 300);
this.Controls.Add(this.panelMain);
this.Controls.Add(this.panelHeaderPadding);
this.Font = new System.Drawing.Font("Tahoma", 8F);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "ButtonForm";
this.Text = "Form1";
this.panelHeaderPadding.ResumeLayout(false);
this.panelHeader.ResumeLayout(false);
this.panelMain.ResumeLayout(false);
this.panelButtonPlaceHolderPadding.ResumeLayout(false);
this.ResumeLayout(false);
#endregion
private ControlContainer panelHeaderPadding;
private ControlContainer panelCloseButton;
private ControlContainer panelMain;
protected internal ControlContainer panelHeader;
private ControlContainer panelButtonPlaceHolderPadding;
protected internal ControlContainer panelContentPlaceHolder;
protected internal ControlContainer panelButtonPlaceHolder;
...and here's what it looks like after I modified it:
using System.Drawing;
namespace HassanFaghihi.StatesInstitution.Forms.Templates.CartoonBlackAndWhite
partial class ButtonForm
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
if (disposing && (components != null))
components.Dispose();
base.Dispose(disposing);
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ButtonForm));
this.panelTopBorder = new System.Windows.Forms.Panel();
this.panelBottomBorder = new System.Windows.Forms.Panel();
this.panelContentPlaceHolder = new WindowsFormsApplication1.ControlContainer();
this.panelHeader = new WindowsFormsApplication1.ControlContainer();
this.panelCloseButton = new WindowsFormsApplication1.ControlContainer();
this.panelButtonPlaceHolder = new WindowsFormsApplication1.ControlContainer();
this.panelHeader.SuspendLayout();
this.SuspendLayout();
// panelTopBorder
this.panelTopBorder.Dock = System.Windows.Forms.DockStyle.Top;
this.panelTopBorder.Location = new System.Drawing.Point(4, 34);
this.panelTopBorder.Name = "panelTopBorder";
this.panelTopBorder.Size = new System.Drawing.Size(492, 4);
this.panelTopBorder.TabIndex = 1;
// panelBottomBorder
this.panelBottomBorder.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelBottomBorder.Location = new System.Drawing.Point(4, 263);
this.panelBottomBorder.Name = "panelBottomBorder";
this.panelBottomBorder.Size = new System.Drawing.Size(492, 4);
this.panelBottomBorder.TabIndex = 2;
// panelContentPlaceHolder
this.panelContentPlaceHolder.BackColor = System.Drawing.Color.White;
this.panelContentPlaceHolder.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelContentPlaceHolder.Location = new System.Drawing.Point(4, 34);
this.panelContentPlaceHolder.Name = "panelContentPlaceHolder";
this.panelContentPlaceHolder.Size = new System.Drawing.Size(492, 233);
this.panelContentPlaceHolder.TabIndex = 0;
// panelHeader
this.panelHeader.BackColor = System.Drawing.Color.White;
this.panelHeader.Controls.Add(this.panelCloseButton);
this.panelHeader.Dock = System.Windows.Forms.DockStyle.Top;
this.panelHeader.Location = new System.Drawing.Point(4, 4);
this.panelHeader.Name = "panelHeader";
this.panelHeader.Size = new System.Drawing.Size(492, 30);
this.panelHeader.TabIndex = 0;
// panelCloseButton
this.panelCloseButton.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelCloseButton.BackgroundImage")));
this.panelCloseButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.panelCloseButton.Dock = System.Windows.Forms.DockStyle.Right;
this.panelCloseButton.Location = new System.Drawing.Point(462, 0);
this.panelCloseButton.Name = "panelCloseButton";
this.panelCloseButton.Size = new System.Drawing.Size(30, 30);
this.panelCloseButton.TabIndex = 0;
this.panelCloseButton.Click += new System.EventHandler(this.panelCloseButton_Click);
// panelButtonPlaceHolder
this.panelButtonPlaceHolder.BackColor = System.Drawing.Color.White;
this.panelButtonPlaceHolder.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelButtonPlaceHolder.Location = new System.Drawing.Point(4, 267);
this.panelButtonPlaceHolder.Name = "panelButtonPlaceHolder";
this.panelButtonPlaceHolder.Size = new System.Drawing.Size(492, 29);
this.panelButtonPlaceHolder.TabIndex = 0;
// ButtonForm
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Black;
this.ClientSize = new System.Drawing.Size(500, 300);
this.Controls.Add(this.panelTopBorder);
this.Controls.Add(this.panelBottomBorder);
this.Controls.Add(this.panelContentPlaceHolder);
this.Controls.Add(this.panelHeader);
this.Controls.Add(this.panelButtonPlaceHolder);
this.Font = new System.Drawing.Font("Tahoma", 8F);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "ButtonForm";
this.Padding = new System.Windows.Forms.Padding(4);
this.Text = "Form1";
this.panelHeader.ResumeLayout(false);
this.ResumeLayout(false);
#endregion
private ControlContainer panelCloseButton;
protected internal ControlContainer panelHeader;
protected internal ControlContainer panelContentPlaceHolder;
protected internal ControlContainer panelButtonPlaceHolder;
private System.Windows.Forms.Panel panelTopBorder;
private System.Windows.Forms.Panel panelBottomBorder;
I removed the padding panels and set the header and footer panels to dock top and dock bottom. I then set the forms padding to 4 so that you get your desired black border around the outside and added two 4 pixel high panels docked to top and bottom
to give you the desired border between header, content and footer panels.
Mick Doherty
http://dotnetrix.co.uk
http://glassui.codeplex.com

Similar Messages

  • Custom Form - Locking Issue

    Hi All,
    I have developed a New Custom form from scratch using TEMPLATE.fmb . I have generated it and it allows me to save OK. I have based the Block on a view(with Row_id as a column) . Also, the primary Key for my Table is vend_cat_id.
    But, when I Query it and press the down arrow key to navigate to records (Its a single record block) or even try to change some field in the block , I get the error "FRM-40657 : record changed or deleted by another user".
    My ON-lock trigger calls my custom package : and my code in my Custom pkg is as below, as per the Forms Dev Guide :
    Any ideas what I may be doing wrong or can check ?
    Many Thanks
    Shankar
    PROCEDURE Lock_Row IS
    counter NUMBER;
    cursor c1 IS
    select *
    from XX1
    where rowid = :blk.row_id
    for update nowait;
    recinfo c1%rowtype;
    begin
    counter := 0;
    loop
    begin
    counter := counter + 1;
    open c1;
    fetch c1 into recinfo;
    if (c1%notfound) then
    close c1;
    fnd_message.Set_Name('FND','FORM_RECORD_DELETED');
    fnd_message.Error;
    Raise form_trigger_failure;
    end if;
    close c1;
    if ( (Recinfo.vend_cat_id = :blk.vend_cat_id)
    AND ( (Recinfo.vendor_id = :blk.vendor_id)
    OR( (Recinfo.vendor_id IS NULL) AND (:blk.vendor_id IS NULL))
    AND ( (Recinfo.vendor_site_id = :blk.vendor_site_id)
    OR( (Recinfo.vendor_site_id IS NULL) AND (:blk.vendor_site_id IS NULL))
    AND ( (Recinfo.start_date_active = :blk.start_date_active)
    OR( (Recinfo.start_date_active IS NULL) AND (:blk.start_date_active IS NULL))
    ) -- end if
    then
    return;
    else
    fnd_message.Set_Name('FND','FORM_RECORD_CHANGED');
    fnd_message.Error;
    raise form_trigger_failure;
    end if;
    exception
    when APP_EXCEPTIONS.RECORD_LOCK_EXCEPTION then
    if (c1%isopen) then
    close c1;
    end if;
    APP_EXCEPTION.Record_Lock_Error(Counter);
    end;
    end loop;
    end lock_row;

    You can create a Forms Runtime Diagnostics (FRD) trace to see if you can try and pinpoint the cause. Pl follow instructions in MOS Doc 150168.1 (Obtaining Forms Runtime Diagnostics (FRD) In Oracle Applications 11i)
    HTH
    Srini

  • Custom forms (with Headstart), issues.  Prompted more than once to save/commit.

    We have found that after analyzing the APPS schema (for CBO), we
    have an issue with custom forms. This issue relates to an
    earlier post on this forum where we get prompted several times
    to save/commit our changes and that the changes are never
    submitted. We've narrowed it down to the QMS_TRANSACTIONS
    table, when ever we run...
    analyze table apps.QMS_TRANSACTIONS estimate statistics;
    Table analyzed.
    Our custom forms will stop working. Why is this? So far we've
    found the only work around is to drop all Headstart objects and
    run the scripts to recreate the objects in the APPS schema.

    Michael,
    This might be a similar problem as they have experienced in
    Japan. Their problem description is as follows;
    -At the beginning, the transaction can be committed from the
    screen.
    -After analyzing APPS schema, it becomes impossible to commit the
    transaction.
    This problem is reproduceable in following condition;
    -Use Oracle 8i 8.1.7.x.
    -Set '_push_join_union_view' parameter to true. (Set by Rapid
    Installer of EBS)
    -Analyze the schema that has qms_transactions table.
    This problem seems to be caused by DB bug (Bug no 2058756).
    If this is indeed your problem a workaround has been described to
    set the event 10195 before analyzing the table.
    Hope this helps.
    Regards,
    Sigrid Gylseth.

  • Issue in Enter Query mode (F11) is not changing color to blue in oracle apps custom form 10g

    Experts,
    I have created a custom form , everything is working fine but when i pressed on the oracle apps custom form ( F11)  then its not changing the form color to blue.
    I have already done below setup but nothing is working fine :-
    1.APP_STANDARD.EVENT('WHEN-NEW-RECORD-INSTANCE'); at your block level Trigger.
    2.Execution Hierarchy Property to "Before" or "After" at block level trigger.
    Could anyone help on this.

    please compile the CUSTOM form and retest the issue
    $ frmcmp_batch.sh module=<form name>.fmb userid=apps/<apps password> output_file=$CUSTOM_TOP/forms/US/<form name>.fmx module_type=form compile_all=special
    AppsMasti
    shairng is Caring

  • Issue with Custom Form opening in Oracle apps

    Hello,
    I am not sure if this is correct place for this question.
    Hi,
    I have created a custom form and tested in forms 6i. I have moved the fmb and fmx files from my local machine to unix box and registered the form in oracle apps (11.5.10).
    However, when I open the form from oracle apps, form opens OK but some of the field in form are blacked out-I am able to see the field but its black in color. When I type in field and highlight it with my mouse, the value I typed shows up.
    What can be issue here?
    I moved both fmb and fmx from my local machine to UNIX box.
    Please help...

    NV,
    Have you resolved your issue? I've run into this before. I failed to subclass all of my objects properly from the APPSTAND.fmb in accordance with the [Oracle Applications Developers Guide | http://download.oracle.com/docs/cd/B25516_18/current/acrobat/115devg.pdf]. If you have your items subclassed correctly, double check to make sure your Forms Builder is using the correct color pallet.
    Hope this helps.
    Craig...
    If mine or someone elses response was helpful, please mark it accordingly

  • Custom Form Transport Render issues

    I have transported a custom wpc form from our Development server to our testing server.  After the transport all content items created with this custom form are displaying an error:
    Cannot render container:   An error occurred while loading the document from the resource content.
    Testing is supposed to start today but obviously can't until this issue is fixed - could someone please point me in the right direction for fixing this error?

    Hi TA,
    Please refer to the SAP Note : Note 1135576 - Transport of pages that contain iView references
    Also, refer to this thread
    https://www.sdn.sap.com/irj/scn/thread?messageID=7078924#7078924
    Cheers!
    Sandeep Tudumu

  • Unable to open java custom form in R12 instance

    Dear friends,
    I am unable to open java custom form from front end.
    Navigation as follows:
    SYSTEM ADMINISTRATOR --> UM_SHIPPING --> ORDERS LOOKUP.
    Can anyone please look into the issue please.
    The error as follows:
    Error page
    you have encountered an unexpected error. please contact the system administrator for assistance.
    Thanks,

    I am unable to open java custom form from front end.
    Navigation as follows:
    SYSTEM ADMINISTRATOR --> UM_SHIPPING --> ORDERS LOOKUP.Was this working before? If yes, any changes been done recently?
    Did you follow the steps in (What Setup is Required to Create Custom JSP Pages to Run on the Ebusiness Suite 11i and R12+? [ID 884200.1])?
    Can anyone please look into the issue please.
    The error as follows:
    Error page
    you have encountered an unexpected error. please contact the system administrator for assistance.Please check Apache log files for details about the error. Please also check if any errors are reported in the database log file.
    Thanks,
    Hussein

  • Unable to close some custom forms

    Hi Gurus,
    We did application migration from Hp-Unix to Sun Solaris. Oracle apps 11.5.10.2 with database 10.2.0.4 and application working good with few issues.
    Issues:
    1. Few custom forms ( message Forms) unable to close. If we close by clicking X mark on top right corner, it does not close can just minimise.
    2. Couple of Custom forms does not open even we have .fmx in the custom folder.
    Need some suggestions on this issues.
    Thank You.

    f60gen module=ARXCUDCI.fmb userid=apps/apps output_file=/ul01/app/applmgr/lasrx/au/11.5.0/forms/US/ARXCUDCI.fmx
    Compiling ON-DELETE trigger on CODE_ASSIG_HIST data block...
    No compilation errors.
    Compiling WHEN-BUTTON-PRESSED trigger on BP_CLOSE item in CODE_ASSIG_HIST data block...
    No compilation errors.
    Compiling WHEN-NEW-ITEM-INSTANCE trigger on CURRENT_RECORD_INDICATOR item in CODE_ASSIG_HIST data block...
    No compilation errors.
    Compiling WHEN-MOUSE-UP trigger in FOLDER_PROMPT_MULTIROW property class...
    No compilation errors.
    Compiling WHEN-BUTTON-PRESSED trigger in FOLDER_OPEN property class...
    No compilation errors.
    Created form file /ul01/app/applmgr/lasrx/au/11.5.0/forms/US/ARXCUDCI.fmx
    Thanks You.

  • Outlook 2013 with Exchange Server - Changed custom form for contacts is not shown

    Hello,
    Our infrastructure:
    Exchange Server 2010
    Outlook 2010
    Outlook 2013
    Windows 7 Pro, Windows 8 Pro and Windows 8.1 Pro
    The situation:
    We've used an old custom form for contacts, worked perfectly fine
    I've updated the form (adding some new custom fields and checkboxes) using Outlook 2013 and publishing the form (with a new name) to the Exchange folder
    I've set the form as default form in our contacts folder
    I've used this Script to set the new form for the existing contacts  and the name of the new form is saved correctly
    BUT if I open a contact in our Exchange contacts folder, Outlook 2013 (Outlook 2010) still shows the old form
    Steps I've taken so far:
    Cleared Outlook forms cache
    Repeated the above steps 1-4 in Outlook 2010
    Switched Cached Exchange Mode off and back on
    Allowed Scripts in Trust Center Settings
    Used a new clean Windows installation with a new Outlook 2013 installation
    Used different Exchange users on different systems, but some behavior when opening contacts
    I'm out of options I can think of, so maybe somebody else has some new view on this problem. 
    Thank you very much in advance!
    Greetings,
    Karl

    Hi,
    Is the Exchange folder in which the custom form is published available to all users?
    From the description, the script used to work for the old custom form, correct? Which version of Outlook did you use with the old custom contact form? Outlook 2010/Outlook 2013 or an earlier version? If you used the script with an earlier version of Outlook,
    we can't make sure it will still work with Outlook 2010/Outlook 2013.
    In addition we may also try creating a new contact form and test the steps to see if it will work.
    Please let me know the result.
    Regards,
    Steve Fan
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to create a Custom form Template..

    Hi Eperts,
    I would like to seek a help from you regarding creating a custom form template on custom BO. could you guide me where i have gone wrong in successfully creating a Print form. I am in dead need of this particular solution for a client. It is hampering my entire scenario......
    1. I had created a Custom BO and I am trying to preview the created form on the OIF screen.
    2. I had created a form on above of the custom BO. This created form and form group is activated and configured as of needed by opening it through ALD (Adobe Life Cycle Designer).
    3. I had created a BAC element with some scoping questions and activated it. After activating it i had deployed the Business configuration.
    4. my solution got updated with the created and deployed BAC elements and i had done scoping for those elements to make my created form available.
    5. I can see my form template in Form Template maitaince under Application user managment WOC. I had made it to be available for all users and published.
    6. All the above steps are done success fully with no errors.
    7. When i accessed my custom BO and tried to preview the created form i am unable to view it and i am seeing the following window.
    Could you help me out in solving this or send me across any detailed document regarding this what you had done previously.
    Thanks in advance for your valuable help...
    Regards...
    Hanu K

    It looks like system didn't identify the form template. So please check if the required configuration for "Preview" modal dialog is done properly. In the SDK documentation, refer to section "8.4.3.4 Create a Preview Button for a Print Form"
    If you have already done the steps mentioned in the section 8.4.3.4, but still facing the issue then let me know.
    Best regards,
    Hari

  • How to initialize org in a custom form in R12 upgrade

    Hi,
    We are migrating a custom form from 11i to R12. But the form and LOVs in the fields dont return any values in R12. The custom views attached to these LOVs, return values in toad when the org is set. We think that the issue is that the org is not initialized in the form.
    Can anyone help on how to resolve this?
    Would it help if we used "MO_GLOBAL.SET_POLICY_CONTEXT('S',fnd_global.ORG_ID);" in the when new form instance trigger in the form.
    Thanks

    Use following code in when-new-form- instance form level trigger
    FND_ORG.CHOOSE_ORG;
    :PARAMETER.ORG_ID:=FND_PROFILE.VALUE('org_id');
    then insert following in pre-insert block level trigger
    :ORG_ID := :PARAMETER.ORG_ID;

  • How to set org in a Oracle custom form

    Hi,
    We are migrating a custom form from 11i to R12. But the form and LOVs in the fields dont return any values in R12. The custom views attached to these LOVs, return values in toad when the org is set. We think that the issue is that the org is not initialized in the form.
    Can anyone help on how to resolve this?
    Would it help if we used "MO_GLOBAL.SET_POLICY_CONTEXT('S',fnd_global.ORG_ID);" in the when new form instance trigger in the form.
    Thanks

    YOu should ask your question in an ebusiness-suite related forum.

  • How to Locate the Custom Form Name  in Oracle Apps

    Hi hussein,
    We had a migration project from 11.0.3 NT to 11.5.10.2 AIX, and it include
    1 form I guess. The client user is showing me the navigation tree where the customized form was located.
    She opened the NT Oracle Apps 11.0.3 and it is showing the following:
    Cash Management Responsibilty
    + Other
    Enter Adjustment >> this is the customized form that she showed me
    When the form opened, i shows a block with parent table "AP_BANK_ACCOUNTS_ALL" and a child table
    "CEC_ADJUSTMENT_RECON".
    My question is, based on the navigation, how do I know which is the location of the forms.fmx? of what
    module was it registered to?
    ==============
    I tried to navigate to the custom form and open it, then click "Help --> About"
    from the menu bar, but it does not show you the form name and the forms executable location path,
    (not like the standard forms of oracle where it shows the form name),
    the "help" being shown is the help of the runtime form in a normal default oracle form window.
    so I assumed that the custom form has been registered but not following the standard procedure.
    ==============
    How do I reverse locate it? base on the "tree" > Enter Adjustment
    Thanks a lot

    Hi,
    Please see (Note: 176852.1 - Integrating Custom Applications with Oracle Applications Release 11i), Step 10-f.
    For the (Help > About) issue, please see if (Note: 556755.1 - Forms Version Not Showing On 'About Oracle Applications' Form From Help Menu) helps.
    Btw, I guess we had a similar discussion before in this EBS 11i Customized Oracle Forms and Reports.
    Regards,
    Hussein

  • Customized form is hanging in 11.5.10.2

    Hi Friends,
    In our 11.5.10.2 instance. one customized form is haning after entering the values and after clicking the confirm button. It is taking nearly 1 hr 30 mins to take the values. It usually take 5 to 10 min.....
    I have enabled the trace for the form and found out that one sql is taking elapsed time almost 1 hr 30 min to complete. It is happening for the pertuculer parameter. But for the same parameter if we want to reproduce the same issue in the very recent clone it is completing fast.....
    Could you please advise the possible resolution.
    Thanks,
    Prashanth.

    Hi Prashanth
    It sounds like your tables and indexes need to be analyzed to gather statistics for the CBO (cost based optimiser) in the database. Try run "Gather Schema Statistics" for the relevant schema in the System Administrator responsibility to analyze your tables.
    See Metalink note: 419728.1 (How To Gather Statistics On Oracle Applications 11.5.10(and above) - Concurrent Process,Temp Tables, Manually) for more info on running the Gather statistics programs.
    Cheers
    Dale

  • Calling custom form to standard form based on passing parameters by pers..

    Hi Everyone,
    I have a urgent requirement related to form personalization like Calling custom form to standard form based on passing some parameters and after click on save icon then custom form should be enable and open. how to achieve this functionality through personalization.
    In brief ......Responsibilty -> Enterprise Asset Management->work order form and in this form's tool menu attach a custom form which comes other responsibility(here no issue) issue is that which trigger and condition used and what should be Action attribute/option. How to disable or enable tool form on some specific navigating the form.
    and how pass the parameter through current using form fields.
    plz help me out........it's urgent.
    thanks,
    Abh....

    Abh,
    Forms Personalization is a feature of the Oracle Enterprise Business Suite (EBS) not a feature of Oracle Forms. Please post your question in the General EBS Discussion forum. If you have a general Forms question, by all means, ask it here! ;-)
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

Maybe you are looking for