Open a new winform below from a textboxGet int value from enum in C#Pasting textbox values to access databaseFading in and fading out for a formpainting a button in winform panel while the panel is scrolledhow to remove the dynamically added control using tag propertyArray of textbox and labels how to get value in submit method in c#how to get .bak extension while creating backup in 3 tier projectHow to get values from multiple textboxes at once?In C# how to open third form inside first form when i click a button of the second form

How do my husband and I get over our fear of having another difficult baby?

Can an untrusted VPN client monitor my network activity?

Enlightenment finding me

Why most footers have a background color as a divider of section?

How to say "respectively" in German when listing (enumerating) things

Can anyone give me the reason why music is taught this way?

Is the "spacetime" the same thing as the mathematical 4th dimension?

Why has Speaker Pelosi been so hesitant to impeach President Trump?

GPLv3 forces us to make code available, but to who?

Should I be an author on another PhD student's paper if I went to their meetings and gave advice?

How to transcribe an arpeggiated 4-note chord to be playable on a violin?

How to interpret the challenge rating of creatures?

Sending mail to the Professor for PhD, after seeing his tweet

Manipulating a Column Containing Key/Value Pairs

Confusion regarding control system of Mars Rover?

PhD Length: are shorter PhD degrees (from different countries) valued differently in other counter countries where PhD Is a longer process?

Approximate the perfect fifth

Realistically, how much do you need to start investing?

Would a horse be sufficient buffer to prevent injury when falling from a great height?

Paint 10 cells of a 10x10 grid

Is "weekend warrior" derogatory?

As a team leader is it appropriate to bring in fundraiser candy?

Is there a pattern for handling conflicting function parameters?

How to identify whether a publisher is genuine or not?



Open a new winform below from a textbox


Get int value from enum in C#Pasting textbox values to access databaseFading in and fading out for a formpainting a button in winform panel while the panel is scrolledhow to remove the dynamically added control using tag propertyArray of textbox and labels how to get value in submit method in c#how to get .bak extension while creating backup in 3 tier projectHow to get values from multiple textboxes at once?In C# how to open third form inside first form when i click a button of the second form






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









0















I need to open a form exactly below from a textbox. My problem is that i include some invisible panels. When a panel become visible and the textbox is changing it's position, then i am getting wrong new winfrom start position.



Here is what i am trying to do.



 foreach (Control ctrl in myPanel.Controls)

if (ctrl is TextBox)

tb = (TextBox)ctrl;

tb.DoubleClick += Tb_DoubleClick;




private void Tb_DoubleClick(object sender, EventArgs e)

TextBox ts = sender as TextBox;
if (ts.BackColor == Color.White)

int x = ts.Location.X;
int y = ts.Location.Y;
VirtualNumPad2 frm = new VirtualNumPad2();
frm.Location = new Point(x, y+200 );
frm.ShowDialog();








enter image description here










share|improve this question


























  • foreach (var tb in myPanel.Controls.OfType<TextBox>()) tb.DoubleClick += Tb_DoubleClick; (slightly simpler way to write that loop)

    – Rufus L
    Mar 28 at 20:45












  • What start position do you want if the panel is not visible?

    – Rufus L
    Mar 28 at 20:47











  • I have upload a picture for understading better what i am trying to do.

    – user10775950
    Mar 28 at 20:50











  • When the panel becomes in/visible, handle that event and recalculate the location.

    – CodingYoshi
    Mar 28 at 20:57












  • I agree with @CodingYoshi. You need to recalculate location based on visibility. I did something similar in past. if (GlobalParameters.IsSupportPanel1) lciPanel1.Visibility = LayoutVisibility.Always; esiLeft.Width = (lycgMain.Width - lycgMain.Padding.Left - lycgMain.Padding.Right - 96 * 8) / 2; else lciPanel1.Visibility =LayoutVisibility.Never; esiLeft.Width = (lycgMain.Width - lycgMain.Padding.Left - lycgMain.Padding.Right - 96 * 7) / 2;

    – Mdyahiya
    Mar 28 at 21:16


















0















I need to open a form exactly below from a textbox. My problem is that i include some invisible panels. When a panel become visible and the textbox is changing it's position, then i am getting wrong new winfrom start position.



Here is what i am trying to do.



 foreach (Control ctrl in myPanel.Controls)

if (ctrl is TextBox)

tb = (TextBox)ctrl;

tb.DoubleClick += Tb_DoubleClick;




private void Tb_DoubleClick(object sender, EventArgs e)

TextBox ts = sender as TextBox;
if (ts.BackColor == Color.White)

int x = ts.Location.X;
int y = ts.Location.Y;
VirtualNumPad2 frm = new VirtualNumPad2();
frm.Location = new Point(x, y+200 );
frm.ShowDialog();








enter image description here










share|improve this question


























  • foreach (var tb in myPanel.Controls.OfType<TextBox>()) tb.DoubleClick += Tb_DoubleClick; (slightly simpler way to write that loop)

    – Rufus L
    Mar 28 at 20:45












  • What start position do you want if the panel is not visible?

    – Rufus L
    Mar 28 at 20:47











  • I have upload a picture for understading better what i am trying to do.

    – user10775950
    Mar 28 at 20:50











  • When the panel becomes in/visible, handle that event and recalculate the location.

    – CodingYoshi
    Mar 28 at 20:57












  • I agree with @CodingYoshi. You need to recalculate location based on visibility. I did something similar in past. if (GlobalParameters.IsSupportPanel1) lciPanel1.Visibility = LayoutVisibility.Always; esiLeft.Width = (lycgMain.Width - lycgMain.Padding.Left - lycgMain.Padding.Right - 96 * 8) / 2; else lciPanel1.Visibility =LayoutVisibility.Never; esiLeft.Width = (lycgMain.Width - lycgMain.Padding.Left - lycgMain.Padding.Right - 96 * 7) / 2;

    – Mdyahiya
    Mar 28 at 21:16














0












0








0








I need to open a form exactly below from a textbox. My problem is that i include some invisible panels. When a panel become visible and the textbox is changing it's position, then i am getting wrong new winfrom start position.



Here is what i am trying to do.



 foreach (Control ctrl in myPanel.Controls)

if (ctrl is TextBox)

tb = (TextBox)ctrl;

tb.DoubleClick += Tb_DoubleClick;




private void Tb_DoubleClick(object sender, EventArgs e)

TextBox ts = sender as TextBox;
if (ts.BackColor == Color.White)

int x = ts.Location.X;
int y = ts.Location.Y;
VirtualNumPad2 frm = new VirtualNumPad2();
frm.Location = new Point(x, y+200 );
frm.ShowDialog();








enter image description here










share|improve this question
















I need to open a form exactly below from a textbox. My problem is that i include some invisible panels. When a panel become visible and the textbox is changing it's position, then i am getting wrong new winfrom start position.



Here is what i am trying to do.



 foreach (Control ctrl in myPanel.Controls)

if (ctrl is TextBox)

tb = (TextBox)ctrl;

tb.DoubleClick += Tb_DoubleClick;




private void Tb_DoubleClick(object sender, EventArgs e)

TextBox ts = sender as TextBox;
if (ts.BackColor == Color.White)

int x = ts.Location.X;
int y = ts.Location.Y;
VirtualNumPad2 frm = new VirtualNumPad2();
frm.Location = new Point(x, y+200 );
frm.ShowDialog();








enter image description here







c#






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 20:49







user10775950

















asked Mar 28 at 20:40









user10775950user10775950

178 bronze badges




178 bronze badges















  • foreach (var tb in myPanel.Controls.OfType<TextBox>()) tb.DoubleClick += Tb_DoubleClick; (slightly simpler way to write that loop)

    – Rufus L
    Mar 28 at 20:45












  • What start position do you want if the panel is not visible?

    – Rufus L
    Mar 28 at 20:47











  • I have upload a picture for understading better what i am trying to do.

    – user10775950
    Mar 28 at 20:50











  • When the panel becomes in/visible, handle that event and recalculate the location.

    – CodingYoshi
    Mar 28 at 20:57












  • I agree with @CodingYoshi. You need to recalculate location based on visibility. I did something similar in past. if (GlobalParameters.IsSupportPanel1) lciPanel1.Visibility = LayoutVisibility.Always; esiLeft.Width = (lycgMain.Width - lycgMain.Padding.Left - lycgMain.Padding.Right - 96 * 8) / 2; else lciPanel1.Visibility =LayoutVisibility.Never; esiLeft.Width = (lycgMain.Width - lycgMain.Padding.Left - lycgMain.Padding.Right - 96 * 7) / 2;

    – Mdyahiya
    Mar 28 at 21:16


















  • foreach (var tb in myPanel.Controls.OfType<TextBox>()) tb.DoubleClick += Tb_DoubleClick; (slightly simpler way to write that loop)

    – Rufus L
    Mar 28 at 20:45












  • What start position do you want if the panel is not visible?

    – Rufus L
    Mar 28 at 20:47











  • I have upload a picture for understading better what i am trying to do.

    – user10775950
    Mar 28 at 20:50











  • When the panel becomes in/visible, handle that event and recalculate the location.

    – CodingYoshi
    Mar 28 at 20:57












  • I agree with @CodingYoshi. You need to recalculate location based on visibility. I did something similar in past. if (GlobalParameters.IsSupportPanel1) lciPanel1.Visibility = LayoutVisibility.Always; esiLeft.Width = (lycgMain.Width - lycgMain.Padding.Left - lycgMain.Padding.Right - 96 * 8) / 2; else lciPanel1.Visibility =LayoutVisibility.Never; esiLeft.Width = (lycgMain.Width - lycgMain.Padding.Left - lycgMain.Padding.Right - 96 * 7) / 2;

    – Mdyahiya
    Mar 28 at 21:16

















foreach (var tb in myPanel.Controls.OfType<TextBox>()) tb.DoubleClick += Tb_DoubleClick; (slightly simpler way to write that loop)

– Rufus L
Mar 28 at 20:45






foreach (var tb in myPanel.Controls.OfType<TextBox>()) tb.DoubleClick += Tb_DoubleClick; (slightly simpler way to write that loop)

– Rufus L
Mar 28 at 20:45














What start position do you want if the panel is not visible?

– Rufus L
Mar 28 at 20:47





What start position do you want if the panel is not visible?

– Rufus L
Mar 28 at 20:47













I have upload a picture for understading better what i am trying to do.

– user10775950
Mar 28 at 20:50





I have upload a picture for understading better what i am trying to do.

– user10775950
Mar 28 at 20:50













When the panel becomes in/visible, handle that event and recalculate the location.

– CodingYoshi
Mar 28 at 20:57






When the panel becomes in/visible, handle that event and recalculate the location.

– CodingYoshi
Mar 28 at 20:57














I agree with @CodingYoshi. You need to recalculate location based on visibility. I did something similar in past. if (GlobalParameters.IsSupportPanel1) lciPanel1.Visibility = LayoutVisibility.Always; esiLeft.Width = (lycgMain.Width - lycgMain.Padding.Left - lycgMain.Padding.Right - 96 * 8) / 2; else lciPanel1.Visibility =LayoutVisibility.Never; esiLeft.Width = (lycgMain.Width - lycgMain.Padding.Left - lycgMain.Padding.Right - 96 * 7) / 2;

– Mdyahiya
Mar 28 at 21:16






I agree with @CodingYoshi. You need to recalculate location based on visibility. I did something similar in past. if (GlobalParameters.IsSupportPanel1) lciPanel1.Visibility = LayoutVisibility.Always; esiLeft.Width = (lycgMain.Width - lycgMain.Padding.Left - lycgMain.Padding.Right - 96 * 8) / 2; else lciPanel1.Visibility =LayoutVisibility.Never; esiLeft.Width = (lycgMain.Width - lycgMain.Padding.Left - lycgMain.Padding.Right - 96 * 7) / 2;

– Mdyahiya
Mar 28 at 21:16













0






active

oldest

votes













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/4.0/"u003ecc by-sa 4.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
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406508%2fopen-a-new-winform-below-from-a-textbox%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406508%2fopen-a-new-winform-below-from-a-textbox%23new-answer', 'question_page');

);

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







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript