Click here to Skip to main content
15,867,308 members
Home / Discussions / Windows Forms
   

Windows Forms

 
Questionabout c# Pin
pawan19937-Sep-12 2:03
pawan19937-Sep-12 2:03 
AnswerRe: about c# Pin
Wes Aday7-Sep-12 2:21
professionalWes Aday7-Sep-12 2:21 
GeneralRe: about c# Pin
Eddy Vluggen7-Sep-12 2:54
professionalEddy Vluggen7-Sep-12 2:54 
QuestionSQL Connection problem in Windows Service Pin
Member 799263524-Aug-12 0:17
Member 799263524-Aug-12 0:17 
AnswerRe: SQL Connection problem in Windows Service Pin
Pete O'Hanlon24-Aug-12 0:21
subeditorPete O'Hanlon24-Aug-12 0:21 
GeneralRe: SQL Connection problem in Windows Service Pin
dojohansen10-Oct-12 5:19
dojohansen10-Oct-12 5:19 
GeneralRe: SQL Connection problem in Windows Service Pin
Pete O'Hanlon10-Oct-12 5:32
subeditorPete O'Hanlon10-Oct-12 5:32 
Questionstrategy for correcting the side-effects of using Dock (which ignore Margin settings) Pin
BillWoodruff14-Aug-12 0:08
professionalBillWoodruff14-Aug-12 0:08 
Hi,

Docking is quite useful in creating UI's, but when you Dock something: the "Margin" property settings of what you Dock are ignored.

In the past, I've created several types of UI's where an "outer" Panel's ControlCollection consists solely of identical "inner" Panels, all of the same type.

Setting all these "inner Panels" to Dock = Top, or whatever is very useful, but they will all be "jammed together" visually: Any Margin.Top or Margin.Top settings of these inner Panels will be ignored.

So far, my strategy for creating a better visual experience has been to use UserControls, not "raw" Panels, for the inner things-that-act-like-Panels:

Each UserControl has an "inner" Panel inside an "outer" Panel. Both these have Dock set to 'Fill. By setting the background color of the outer Panel to the same color as its outermost Panel, "the host," and then setting the Padding property of the outer Panel in the UserControl to offset the differently colored inner Panel of the UC:

Then, when they get all "jammed together" by docking, you can at least simulate a nice visual effect of space between the Docked inner Panels.

A logical question for you to be asking right now is: why not just set the UserControl BackColor to the same color as its host container, and have only one Panel in the UC: while I have done this, the simple answer is that I prefer the more fine-grained control possible (I can create fancier visual effects), by having outer/inner Panels in the UC.

I wonder if there is a simpler way to approach this ?

I guess in an ideal world ... hah ... we could have an over-load of the Dock mechanism, that you would pass a bool into with a name like "respectMarginSettings" Smile | :)

Should I add some links to "before" and "after" small .jpg screen-shots to this question, to make crystal-clear the visual results I am talking about ?

best, Bill
"Everything we call real is made of things that cannot be regarded as real." Niels Bohr

AnswerRe: strategy for correcting the side-effects of using Dock (which ignore Margin settings) Pin
dojohansen10-Oct-12 6:01
dojohansen10-Oct-12 6:01 
QuestionEditingPanel Erasing Top Cell Border Pin
Mark Regal13-Aug-12 19:06
Mark Regal13-Aug-12 19:06 
AnswerRe: EditingPanel Erasing Top Cell Border Pin
Mark Regal14-Aug-12 3:14
Mark Regal14-Aug-12 3:14 
QuestionVS2010 Setup and Deployment Project - CommonAppDataFolder for XP Pin
Member 269415310-Aug-12 9:05
Member 269415310-Aug-12 9:05 
AnswerRe: VS2010 Setup and Deployment Project - CommonAppDataFolder for XP Pin
Dave Kreskowiak10-Aug-12 14:19
mveDave Kreskowiak10-Aug-12 14:19 
GeneralRe: VS2010 Setup and Deployment Project - CommonAppDataFolder for XP Pin
Member 269415313-Aug-12 2:18
Member 269415313-Aug-12 2:18 
AnswerRe: VS2010 Setup and Deployment Project - CommonAppDataFolder for XP Pin
ictxiangxin13-Aug-12 4:03
ictxiangxin13-Aug-12 4:03 
QuestionWrapping of Data Grid View column Pin
ukraju5-Aug-12 20:58
ukraju5-Aug-12 20:58 
AnswerRe: Wrapping of Data Grid View column Pin
908236510-Aug-12 12:59
908236510-Aug-12 12:59 
QuestionWindows Form Pin
DSPNEOqqq3-Aug-12 9:15
DSPNEOqqq3-Aug-12 9:15 
RantRe: Windows Form Pin
Eddy Vluggen3-Aug-12 9:30
professionalEddy Vluggen3-Aug-12 9:30 
GeneralRe: Windows Form OT Pin
Wes Aday3-Aug-12 9:41
professionalWes Aday3-Aug-12 9:41 
GeneralRe: Windows Form OT Pin
Eddy Vluggen3-Aug-12 10:01
professionalEddy Vluggen3-Aug-12 10:01 
AnswerRe: Windows Form Pin
Christian Amado6-Aug-12 10:47
professionalChristian Amado6-Aug-12 10:47 
AnswerRe: Windows Form Pin
BillWoodruff11-Aug-12 15:27
professionalBillWoodruff11-Aug-12 15:27 
GeneralRe: Windows Form Pin
Eddy Vluggen12-Aug-12 3:43
professionalEddy Vluggen12-Aug-12 3:43 
QuestionWindows Form Application Size Issue Pin
ukraju29-Jul-12 19:45
ukraju29-Jul-12 19:45 

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.