winforms tab does not fit the window size
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I created a .NET Framework 4.0 winforms project and added a "tab" as you can see in the following picture:
From the View Designer both tabs (Profile and Features) looks like they fit the rectangle window, but when I run the program, the "Profile" tab looks the same but the "Features" tab suddenly does not fit the rectangle anymore and looks like that:
I don't want to give the user the option to enlarge the window.
I am wondering why it looks like it fit the rectangle window but when I run the application, it does not.
This is the "Features" tab from the MainForm:
this.TabPage2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.TabPage2.Controls.Add(this.listBoxShowFriendsBirthday);
this.TabPage2.Controls.Add(this.buttonShowFriendsBirthday);
this.TabPage2.Controls.Add(this.label1);
this.TabPage2.Controls.Add(this.monthCalendar1);
this.TabPage2.Controls.Add(this.postTextBox);
this.TabPage2.Controls.Add(this.pictureBoxEvent);
this.TabPage2.Controls.Add(this.listBoxFetchEvents);
this.TabPage2.Controls.Add(this.buttonFetchEvents);
this.TabPage2.Controls.Add(this.postButton);
this.TabPage2.Location = new System.Drawing.Point(8, 39);
this.TabPage2.Name = "tabPage2";
this.TabPage2.Padding = new System.Windows.Forms.Padding(3);
this.TabPage2.Size = new System.Drawing.Size(1976, 806);
this.TabPage2.TabIndex = 1;
this.TabPage2.Text = "Features";
this.TabPage2.UseVisualStyleBackColor = true;
c# .net winforms
add a comment |
I created a .NET Framework 4.0 winforms project and added a "tab" as you can see in the following picture:
From the View Designer both tabs (Profile and Features) looks like they fit the rectangle window, but when I run the program, the "Profile" tab looks the same but the "Features" tab suddenly does not fit the rectangle anymore and looks like that:
I don't want to give the user the option to enlarge the window.
I am wondering why it looks like it fit the rectangle window but when I run the application, it does not.
This is the "Features" tab from the MainForm:
this.TabPage2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.TabPage2.Controls.Add(this.listBoxShowFriendsBirthday);
this.TabPage2.Controls.Add(this.buttonShowFriendsBirthday);
this.TabPage2.Controls.Add(this.label1);
this.TabPage2.Controls.Add(this.monthCalendar1);
this.TabPage2.Controls.Add(this.postTextBox);
this.TabPage2.Controls.Add(this.pictureBoxEvent);
this.TabPage2.Controls.Add(this.listBoxFetchEvents);
this.TabPage2.Controls.Add(this.buttonFetchEvents);
this.TabPage2.Controls.Add(this.postButton);
this.TabPage2.Location = new System.Drawing.Point(8, 39);
this.TabPage2.Name = "tabPage2";
this.TabPage2.Padding = new System.Windows.Forms.Padding(3);
this.TabPage2.Size = new System.Drawing.Size(1976, 806);
this.TabPage2.TabIndex = 1;
this.TabPage2.Text = "Features";
this.TabPage2.UseVisualStyleBackColor = true;
c# .net winforms
Is your application DPI-Aware? I assume it's not. Read here: How to configure an app to run correctly on a machine with a high DPI setting. Some notes I've written: (these are being updated).
– Jimi
Nov 22 '18 at 13:34
add a comment |
I created a .NET Framework 4.0 winforms project and added a "tab" as you can see in the following picture:
From the View Designer both tabs (Profile and Features) looks like they fit the rectangle window, but when I run the program, the "Profile" tab looks the same but the "Features" tab suddenly does not fit the rectangle anymore and looks like that:
I don't want to give the user the option to enlarge the window.
I am wondering why it looks like it fit the rectangle window but when I run the application, it does not.
This is the "Features" tab from the MainForm:
this.TabPage2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.TabPage2.Controls.Add(this.listBoxShowFriendsBirthday);
this.TabPage2.Controls.Add(this.buttonShowFriendsBirthday);
this.TabPage2.Controls.Add(this.label1);
this.TabPage2.Controls.Add(this.monthCalendar1);
this.TabPage2.Controls.Add(this.postTextBox);
this.TabPage2.Controls.Add(this.pictureBoxEvent);
this.TabPage2.Controls.Add(this.listBoxFetchEvents);
this.TabPage2.Controls.Add(this.buttonFetchEvents);
this.TabPage2.Controls.Add(this.postButton);
this.TabPage2.Location = new System.Drawing.Point(8, 39);
this.TabPage2.Name = "tabPage2";
this.TabPage2.Padding = new System.Windows.Forms.Padding(3);
this.TabPage2.Size = new System.Drawing.Size(1976, 806);
this.TabPage2.TabIndex = 1;
this.TabPage2.Text = "Features";
this.TabPage2.UseVisualStyleBackColor = true;
c# .net winforms
I created a .NET Framework 4.0 winforms project and added a "tab" as you can see in the following picture:
From the View Designer both tabs (Profile and Features) looks like they fit the rectangle window, but when I run the program, the "Profile" tab looks the same but the "Features" tab suddenly does not fit the rectangle anymore and looks like that:
I don't want to give the user the option to enlarge the window.
I am wondering why it looks like it fit the rectangle window but when I run the application, it does not.
This is the "Features" tab from the MainForm:
this.TabPage2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.TabPage2.Controls.Add(this.listBoxShowFriendsBirthday);
this.TabPage2.Controls.Add(this.buttonShowFriendsBirthday);
this.TabPage2.Controls.Add(this.label1);
this.TabPage2.Controls.Add(this.monthCalendar1);
this.TabPage2.Controls.Add(this.postTextBox);
this.TabPage2.Controls.Add(this.pictureBoxEvent);
this.TabPage2.Controls.Add(this.listBoxFetchEvents);
this.TabPage2.Controls.Add(this.buttonFetchEvents);
this.TabPage2.Controls.Add(this.postButton);
this.TabPage2.Location = new System.Drawing.Point(8, 39);
this.TabPage2.Name = "tabPage2";
this.TabPage2.Padding = new System.Windows.Forms.Padding(3);
this.TabPage2.Size = new System.Drawing.Size(1976, 806);
this.TabPage2.TabIndex = 1;
this.TabPage2.Text = "Features";
this.TabPage2.UseVisualStyleBackColor = true;
c# .net winforms
c# .net winforms
edited Nov 22 '18 at 8:11
Lennart
6,206125266
6,206125266
asked Nov 22 '18 at 8:04
I.zvI.zv
12610
12610
Is your application DPI-Aware? I assume it's not. Read here: How to configure an app to run correctly on a machine with a high DPI setting. Some notes I've written: (these are being updated).
– Jimi
Nov 22 '18 at 13:34
add a comment |
Is your application DPI-Aware? I assume it's not. Read here: How to configure an app to run correctly on a machine with a high DPI setting. Some notes I've written: (these are being updated).
– Jimi
Nov 22 '18 at 13:34
Is your application DPI-Aware? I assume it's not. Read here: How to configure an app to run correctly on a machine with a high DPI setting. Some notes I've written: (these are being updated).
– Jimi
Nov 22 '18 at 13:34
Is your application DPI-Aware? I assume it's not. Read here: How to configure an app to run correctly on a machine with a high DPI setting. Some notes I've written: (these are being updated).
– Jimi
Nov 22 '18 at 13:34
add a comment |
2 Answers
2
active
oldest
votes
I suggest you to use Dock and Anchor properties of controls. This way you can also allow to user resizing the window.
Dock:
Anchor:
See - How to: Anchor and Dock Child Controls in a FlowLayoutPanel Control
I want to leave the window size as is and don't let the user play with it
– I.zv
Nov 22 '18 at 8:28
Anyway, if you use Dock and Anchor properties you will get what you need. Give a try
– ikram
Nov 22 '18 at 8:30
add a comment |
To prevent the user from rescaling their window:
c# how to prevent user from resizing my application window?
but aside from that, I'd suggest, (just like ikram said) to use docking, that way you're certain your lay-out will remain, no matter the resolution/screensize the user has.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53426338%2fwinforms-tab-does-not-fit-the-window-size%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I suggest you to use Dock and Anchor properties of controls. This way you can also allow to user resizing the window.
Dock:
Anchor:
See - How to: Anchor and Dock Child Controls in a FlowLayoutPanel Control
I want to leave the window size as is and don't let the user play with it
– I.zv
Nov 22 '18 at 8:28
Anyway, if you use Dock and Anchor properties you will get what you need. Give a try
– ikram
Nov 22 '18 at 8:30
add a comment |
I suggest you to use Dock and Anchor properties of controls. This way you can also allow to user resizing the window.
Dock:
Anchor:
See - How to: Anchor and Dock Child Controls in a FlowLayoutPanel Control
I want to leave the window size as is and don't let the user play with it
– I.zv
Nov 22 '18 at 8:28
Anyway, if you use Dock and Anchor properties you will get what you need. Give a try
– ikram
Nov 22 '18 at 8:30
add a comment |
I suggest you to use Dock and Anchor properties of controls. This way you can also allow to user resizing the window.
Dock:
Anchor:
See - How to: Anchor and Dock Child Controls in a FlowLayoutPanel Control
I suggest you to use Dock and Anchor properties of controls. This way you can also allow to user resizing the window.
Dock:
Anchor:
See - How to: Anchor and Dock Child Controls in a FlowLayoutPanel Control
answered Nov 22 '18 at 8:11
ikramikram
2,18221026
2,18221026
I want to leave the window size as is and don't let the user play with it
– I.zv
Nov 22 '18 at 8:28
Anyway, if you use Dock and Anchor properties you will get what you need. Give a try
– ikram
Nov 22 '18 at 8:30
add a comment |
I want to leave the window size as is and don't let the user play with it
– I.zv
Nov 22 '18 at 8:28
Anyway, if you use Dock and Anchor properties you will get what you need. Give a try
– ikram
Nov 22 '18 at 8:30
I want to leave the window size as is and don't let the user play with it
– I.zv
Nov 22 '18 at 8:28
I want to leave the window size as is and don't let the user play with it
– I.zv
Nov 22 '18 at 8:28
Anyway, if you use Dock and Anchor properties you will get what you need. Give a try
– ikram
Nov 22 '18 at 8:30
Anyway, if you use Dock and Anchor properties you will get what you need. Give a try
– ikram
Nov 22 '18 at 8:30
add a comment |
To prevent the user from rescaling their window:
c# how to prevent user from resizing my application window?
but aside from that, I'd suggest, (just like ikram said) to use docking, that way you're certain your lay-out will remain, no matter the resolution/screensize the user has.
add a comment |
To prevent the user from rescaling their window:
c# how to prevent user from resizing my application window?
but aside from that, I'd suggest, (just like ikram said) to use docking, that way you're certain your lay-out will remain, no matter the resolution/screensize the user has.
add a comment |
To prevent the user from rescaling their window:
c# how to prevent user from resizing my application window?
but aside from that, I'd suggest, (just like ikram said) to use docking, that way you're certain your lay-out will remain, no matter the resolution/screensize the user has.
To prevent the user from rescaling their window:
c# how to prevent user from resizing my application window?
but aside from that, I'd suggest, (just like ikram said) to use docking, that way you're certain your lay-out will remain, no matter the resolution/screensize the user has.
answered Nov 22 '18 at 8:40
Dennis VanhoutDennis Vanhout
917
917
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53426338%2fwinforms-tab-does-not-fit-the-window-size%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Is your application DPI-Aware? I assume it's not. Read here: How to configure an app to run correctly on a machine with a high DPI setting. Some notes I've written: (these are being updated).
– Jimi
Nov 22 '18 at 13:34