Jump to content

Visual studio question

- - - - -

  • Please log in to reply
3 replies to this topic

#1
Braydon Vaughan

Braydon Vaughan

    Newbie

  • Members
  • PipPip
  • 15 posts
In visual studio, I made a windows application is there any way that I can lock the window in the sense that the user cannot move it around?

#2
CommittedC0der

CommittedC0der

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,565 posts
I dont think there is property to set to fix this, but you could set the form back when someone try's to move it.
        int xPos = 50; [COLOR=#006400] // x Locked position[/COLOR]
        int yPos = 50;  [COLOR=#006400]// y Locked position[/COLOR]
private void Form1_Move(object sender, EventArgs e)
        {
            this.Location = new Point(xPos, yPos);
        }

Good luck ~ Committed. :)
A man can be defined by what he does when no one is looking.
Science is only an educated theory, which we cannot disprove.

#3
Vaielab

Vaielab

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 547 posts
In the property of the form, set the FormBorderStyle to none... but this will remove the border
A other way to do so is with the Form1_LocationChanged event

Do something like this

 private void Form1_LocationChanged(object sender, EventArgs e)

        {

            this.Location = new Point(0, 0);

        }

where 0,0 is the position of your form
You didn't specify what language, this code is for c#, but the vb.net or c++ code will be very similar

#4
Braydon Vaughan

Braydon Vaughan

    Newbie

  • Members
  • PipPip
  • 15 posts
Nevermind, all probems solved, thank you all for the help.

Edited by Braydon Vaughan, 17 August 2011 - 12:19 PM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users