c#


how to open a new window on middle of the parent window in c#


In C# windows desktop application I need to make a popup login window like this Popup login window.
When i tried this I failed to make like this login window.If I make a window like this,The popup window open different time different location.
I need the child (mean the login window)open on the top of the parent window, and this window must be unmovable and in the mean time the parent window inaccessible until i close the child window.
Try this code
<Grid x:Name="grdOverlay" Panel.ZIndex="1000" Visibility="Visible" KeyDown="grdOverlay_KeyDown">
<Grid.Background>
<SolidColorBrush Color="Black" Opacity=".5"/>
</Grid.Background>
</Grid>
If windows forms application, you can set starting position of your form by setting `form.StartPosition'. example given here
Form.StartPosition can be set by any value from FormStartPosition enum, described here
Let's say your child form named childForm.
1. go to your childForm design and in properties find StartPosition and change its value to CenterScreen. It will cause to load your form in center of screen always.
2. for making it unmovable, in properties, change FormBorderStyle to none. In this case you need to create a close button for your login form and in its on click event you should use this code:
this.Close();
3. from your main form you should open your login form using ShowDialog which cause your main form to be inaccessible while your login form is open.
childForm login = new childForm();
login.ShowDialog();

Related Links

EventHandler vs. EventHandler<TEventArgs>
Grouping datagridview result by date and sum sales
WPF TabItem border isn't reflecting BorderThickness property
Fastest way of getting properties of ManagementObject
MS Bot builder IForm Invalid Type Exception:Has xxx Expect yyy
Table.compute() C# MIN, MAX and AVG
Post Build Event: Build Class Library and Copy Bin Folder Contents
Loading a Large Form in MVC
Encrypt/Decrypt String for Functions [duplicate]
How to set a different language to Bot Framework in Facebook Channel?
SQL display table in vertical
how to converter unreadable block of code in a class
Practical examples of when to use a ListPool or any pool of collections
I want to take array of 30 and use 3 threads that will sum the 30 values.Each thread adds in groups of 10
Send data from ASP.NET MVC to desktop application
What is the APEv1 tag identifier?

Categories

HOME
gcc
mysqli
opencv4android
hiveql
confluence-rest-api
gnuradio
handlebars.js
yacc
ionic-native
phpexcel
minimax
opengrok
github-flavored-markdown
ringcentral
ofbiz
alert
javaagents
concatenation
devexpress-mvc
core-animation
pixels
ballerinalang
smart-device
workflow-foundation
libxml2
drombler-fx
large-files
drawrect
foxpro
textview
kubectl
flickr
android-scrollview
traitsui
offset
openvms
mootools
javafxports
motherboard
mybatis-generator
amazon-fire-tv
django-cors-headers
mef
jks
nao-robot
django-tables2
jscoverage
nls
firebase-job-dispatcher
rowname
instaparse
boost-bind
aws-kms
wordpress-plugin
videoview
nonblocking
dynamics-nav-2013
github-for-mac
gtkwave
maven-antrun-plugin
edgar
properties-file
tess4j
photogrammetry
mergecursor
radgrid
autopep8
firebase-tools
caption
clearcanvas
system.net
rails-migrations
smartxls
winrun4j
rssi
elixir-framework
boofcv
codio
grunt-contrib-imagemin
record-locking
kademlia
select2-rails
exi
auctex
database-restore
nsregularexpression
motordriver
certificate-revocation
android-memory
ios6-maps
filedialog
bindinglist
unordered-set
jqzoom
discussion-board
isgl3d
soapexception
overlays
viewdata
simultaneous
oaw
for-xml
lts
opengl-to-opengles
disk-based

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App