Persist Control Location On A Form?

Jun 16, 2010

I need to save the controls location and size on the parent form to file. My aim is to be able to simply copy that file to the path where an instance of my program is running and then it automatically applies the previously saved layout of controls. How can I use My.Settings to do that or is there another better option?

View 12 Replies


ADVERTISEMENT

String Popup Location Of A Form Control?

Feb 22, 2012

After a little research, I managed to get a working Help button added to my form. I did this by setting the MinimizeBox and MaximizeBox properties of the form to false, set the ShowHelp property of the form to true and added a HelpProvider component. I then added a string to each control's HelpString property that I want to display help on.

Everything works with one minor exception. When I clcik the help button in the form and then select a control, the HelpString (tooltip) is displayed in the far lower left corner of the screen. I assumed I would see this pop up at the cursor rather than where it is. I cannot seem to find a property to control the position of the HelpString popup.

View 3 Replies

Get X And Y Coordinates Of A Control's Location On Form Relative To Screens Top Left Corner?

May 23, 2009

How can I get x and y coordinates of a control's location on a form relative to the Screens Top Left corner?

For example, if I have 3 labels on a form and I want label2 and label3 to display the x and y of label1 relative to the screens top and left corner.

When running the app, as the form's possition is changed label 2 and 3 update the coordinate of Label1's possition relative to the top left of the screen.

View 6 Replies

Coordinates - Control Relative To The FORM - "Control.Location DUH!!"

Nov 13, 2008

I have a control on a form - I need to know the coordinates of that control relative to the FORM.

Now before I get six replies saying, "Control.Location DUH!!" that only works when the control's parent IS the form. What if the control is nested inside one or more container controls?

Could I write a routine that crawls up all parent containers until I reach the form calculating each offset as I go? Sure! But this extremely crude operation seems clunky to me - What I'm looking for is something a little cleaner.

So far the closest I've been able to come is this:
Dim ClientPoint As Point = Ctrl.PointToScreen(Ctrl.Location)
Dim LocationLeft As Integer = (ClientPoint.X - Ctrl.ParentForm.Left) - Ctrl.Left
Dim LocationTop As Integer = (ClientPoint.Y - Ctrl.ParentForm.Top) - Ctrl.Top

The problem with the above code is: It does NOT take the Form's border or Titlebar into consideration... so this calculated location would be off slightly depending on what kind of border the form has.

View 3 Replies

C# - Persist Dropdownlist Selection Located In A Control Located In A Masterpage?

Apr 1, 2012

I have default.aspx used masterpage, in master page i have a control called DefaultMenuContent, this control have a dropdownlist with autopostback, the problem is loosing the selection even if i use Is Not PostBack in control's load event, how to persist the dropdownlist selection?

In Master:

<asp:ContentPlaceHolder ID="MenuContentPlaceHolder" runat="server">
<art:DefaultArabicMenu ID="DefaultMenuContent" runat="server" />
</asp:ContentPlaceHolder>

[code]....

View 1 Replies

VS 2010 Changing Control Parent Property Changes Control Location Position?

Feb 16, 2011

I'm trying to make a program with transparent labels over pictureboxes and when I set the label Parent to the PictureBox the position of the label changes.

View 2 Replies

Location - Get The Nearest Control To A Control Of Choice?

May 14, 2010

Is there an easy way to get the nearest control to a control of choice? I have a picture box and some other moving controls. I want to delete the nearest control to my picture box. So I have to get the position of all controls and delete that with the Location nearest to the Location of my picture box. I'm not sure about how to do that the best way.

View 2 Replies

Persist The Datagridview Changes?

Mar 1, 2011

I have a datagridview in a form that is dynamically bound to a datatable. When the user clicks a button I update certian columns of the current row with code like this:

Dim i As Integer = myDataGridView.CurrentRow.Index
Me.myDataGridView.Item("closed", i).Value = DBNull.Value

View 4 Replies

A Boolean Value Does Not Persist After Publishing

May 1, 2009

I'm working with Visual Basic 2008 Express. My application opens with the Terms screen, a form that asks the user to declare his acceptance of certain terms and conditions or to decline. If he accepts, the app opens the main screen, giving him access to all the app's facilities. If he declines, the app gives him a message and then closes. Whether he chooses to accept or decline, the app puts his decision in My.Settings so that it can be used next time the app is opened. In this way he is presented with the Terms screen on the next opening if he declined on the last run. But if he accepted on the last run, he is presented with the main screen on his next opening.

All works fine when I do a debug run. But when I build and publish the app onto my desktop it opens with the Main screen instead of the Terms screen.

why it works on F5 but not after publishing?

Public
Class frmTerms
Dim Accept As Boolean

[Code].....

View 11 Replies

Can Datasets Persist In VS 2008

Sep 4, 2009

I need to very quickly write an exe system on a laptop where when the laptops are connected to the network they read a database table and store the data locally, so staff can use the laptop while they roam.The laptops have quite small capacity and the company would prefer not to use SQL Express or Access.

My question is, can the data initially be downloaded into the exe application via a dataadapter and dataset, and will that dataset the retain the downloaded data, or will I need to ensure the dataset is written to an XML file and then loaded/unloaded each time the laptop application is started while the staff are travelling ?

View 2 Replies

IDE :: Windows Service - How To Persist A Value

Jun 6, 2012

I am a web developer who now has to change a Windows service. I never worked on a Windows service before. I have a several programs that can run within this service. I want to persist a value of a variable from program to program.

View 1 Replies

Viewstate Does Not Persist After Postback

Mar 21, 2012

I'm having some problems in persisting the viewstate on postback for a Control (vb.net)

here's some code i've put in my control[code]...

I'm setting EnableViewState = "true" everywhere i can, but still no result. Do i really need to set those properties here. (ViewStateMode and EnableViewState) If not, where should i handle this and what is the difference between those properties?

View 4 Replies

Set Location Of Child Form To A Specified Point Of Parent Form

Nov 11, 2010

how to set location of child form to a specified point of parent form.Below is my code but it is not working for setting the location.[code]

View 1 Replies

Forms :: Control The Load Location Of An App?

Mar 19, 2009

I am developing a windows app in VS2008 to be used along side ESRI�s ArcMap. Most ArcMap users will have dual monitors and I would like the user to be able to choose which monitor my app is loaded on to.

When I deploy the app using the standard install package, the app will load onto which ever monitor the user places the desktop shortcut. However, when using the ClickOnce method of deployment, the placement of the shortcut does not matter and the app always loads on the primary display monitor.

Is there a way to control where an app is loaded by code or any other method?

View 1 Replies

How To Give Location To Control T Runtime

Mar 27, 2010

I am trying to add textbox at runtime. but my problem is textbox is

added on same location but i want to add textbox at different location.

Code that i am using is :[code...]

View 2 Replies

Image Location In The Splitter Control?

Aug 13, 2011

I am working on splitter control in winform, I want to insert the image in the splitter and make the image location to stay at the same place in the splitter when I am moving them.

When i am moving the splitter, the image will move around in winform which it is a messy.

Code:
Public Class Form1
Private Sub Splitter1_SplitterMoved(ByVal sender As System.Object, ByVal e As System.Windows.Forms.SplitterEventArgs) Handles Splitter1.SplitterMoved

[Code]....

View 1 Replies

Picturebox Control Location On Screen?

Dec 17, 2009

I have a picturebox (pbRows) that I want to always be aligned with the right side of the screen. The form may be wider than this (I have a horizontal scrollbar), but the picturebox always needs to be along the right edge of the screen. Currently I have this code snippet in the form_load subroutine:

Dim rowsX As New Integer rowsX = Screen.PrimaryScreen.Bounds.Width - pbRows.Width pbRows.Location = New Point(rowsX, 25) However, the picturebox is aligned with the right edge of the form (initially hidden off the screen). Am I missing something obvious?

View 13 Replies

C# - Private Key Does Not Persist Even With X509KeyStorageFlags.PersistKeySet

Dec 9, 2010

I have been searching for quite a while now but i am unable to find the answer to the following. I am storing a key pair in Windows Store, and recently started receiving the "Keyset does not exist" error. Investigating a bit further i found out it could be two things, 1 - The private key is not stored with the persist key set attribute (X509KeyStorageFlags.PersistKeySet) and 2 - access rights to the key. I have tried both 1 and 2 with no success on one machine (in my machine it works apparently). The strange thing is that when i look into MicrosoftCryptoRSAMachineKeys (and S-1-5-18) the key remains there but only for a period of time then it is deleted which means that it is not persisting.

//If decoded then save as RSACryptoServiceProvider
newCert.PrivateKey = DecodePrivateKey(privateKeyFile, pkPassword)
if (newCert.PrivateKey == null)

[Code]....

I have just found out today that since i am doing this through a WCF service, the application pool is deleting the private key when it reaches its idle time limit so i am completely sure that it is the application pool the one disposing of the private key which causes the key to be deleted from the MicrosoftCryptoRSAMachineKeys and S-1-5-18 folders. Today i left a test running where i disabled Idle time shut down from the application pool bu i am still not sure if the private key will stop persisting with a restart or something like that?

Would anybody know how to make the application pool stop deleting my private keys?

View 2 Replies

Getting ListView Data To Persist After Shutdown?

Jan 13, 2011

I need some general advice about using ListView. The program was originally written in VB2002, but now it's running in VB2008.The results of my program would typically be a ListView of 30 lines by 8 columns. I need to be able to save this data so that it persists after I close the program. There will never be a need to manipulate the data, so I'm looking for something simple. (There will be a need to print it.) I'm presuming that I need to link to a database to save the data. Correct? If so, can I use the one in Microsoft Works (which I already have), or do I need to get Microsoft Access, or is there some other better (simpler?) alternative?

View 7 Replies

Persist Browser Scroll Position

Oct 10, 2011

I'm looking for a simple, efficient way to get the position of the browser vertical scrollbar and save it into a session variable in an ASP page. What I'm trying to do is when the user changes a page I've the scroll position stored in a session variable so that when the user returns to the page the page will scroll to their last position.Is there a way to do this? I've seen examples of persisting the scroll position on postback but nothing yet doing exactly what I'm trying to do [code]

View 1 Replies

Button Control Move From Its Original Location

Nov 1, 2010

i made a little from control which hold 3 button controls lined, in the designer they're all lined up perfectly but when i built and ran the application the middle button shift a bit to the left and overlap the left control, someone has any idea why its happen ?

View 1 Replies

Control Installation Location Of Click Once Folders?

Sep 8, 2009

Is there any way to change the installion of a click once app to the program files location so that it will be availabe to all users? Right now it is burying the location of the files within the user folder.

View 2 Replies

Forms :: Copy A Control And Place It In Another Location?

Sep 10, 2011

Does anyone know how to copy a control (button, panel etc...) and place the control with the same click event on another part of a form while keeping the original in the same location? I have a custom user control that I created that has special features on click. If I have the control on the left side and want to drag it over to the right side I want the control duplicated, as this control can be duplicated unlimited times, and still have the same click event.

[Code]...

View 2 Replies

Image Location (code) Of PictureBox Control

May 16, 2011

I'm inexperienced with windows forms (vb.net), and I have a rather silly question.I'm opening an old project of someone elses, and there's a PictureBox control on the form. The PictureBox has a photo, and I'm trying to find the location of the photo on the computer but can't find it.In ASPX, I can just look at the code behind and find out where the tags are pointing to (for the photo).The only code that exists for my object, with the image property is this: [code]

View 4 Replies

VS 2008 Manipulating A Control's Location Property?

Jun 27, 2009

This one has me stumped. I'm trying to change the location of an object's X position so that it has a marquee like effect. I'm doing this with buttons and text, etc..

PictureBox1.Location = New Point(PictureBox.Location.X - 10, PictureBox.Location.Y)With the intention of it moving 10px to the left. I would then use a timer, but it scrolls automatically for me,

View 2 Replies

Set A Form's Location In Relation To A Picture Box In Another Form?

Sep 29, 2010

I have created a form with pictures of plants on it (note these pictures are moved to the left when the left button is pressed). When a mouse is placed over or hovers over one of these pictures i want a mini form to pop up beside the plant with the plants name on it.

[Code]...

View 3 Replies

Adding A Variable That Will Persist When The Program Closes?

Jul 26, 2011

Sorry for the extra long title, Here's what I want to do.I want to give the user the option of using or not using specific features of the program.If I can set a simple yes or no value that wil persist each time the program run and then depending on the variable turn off or on the feature at start

View 14 Replies

Connection String Persist Security Info?

Jun 27, 2010

does anyone knwos what is the point of persist security info? i have always leave it at default (i'm not sure what value it is) but when i pass the application to my friend he seem not to be able to connect to the db. (btw the application calls

View 2 Replies

How To Persist Anonymous Types Instances Through NHibernate

Feb 12, 2010

Instinctively, I would say that this is impossible, as NHibernate needs to know some mapping information on how to persist a given type. Thus, I encountered some situations in which I could use such a feature. For instance, through a named query or something like so. On the other hand, using a named query would require me to make an addition to the configuration file.

Let's suppose we have an application interacting with some underlying datastore. This datastore is configured through the NHibernate configuration file. Then, I wish to have NHibernate load only a subset of an entity properties, from another subsystem to which my application shouldn't need to interact much, so it is not worthy to define classes for this system, as I only need a fraction of this alien system's information, let's say three out of thirty-two data columns. For that matter, if I chose to load only those three columns let's say for performance concerns, I would then use an anonymous type, perform the required action onto this information, then persist it back to the datastore. Now, it wouldn't be of much interest to do so if I only had one entity to get loaded from the datastore, so let's say I have about 75,000 rows to load into my process. I then shall consider this subset option very seriously!

What strategy should you choose in such situation, if you needed to persist these changes to a subset only of this entity's properties?FYI: I am asking because I must write specific rules of usage with NHibernate, such rules that even a beginner developer would even be able to use it without knowing too much about NHibernate, but only following the rules and guidance of the technical documents I have to produce.

View 1 Replies

Make 3 Datagridview Control In 3 Tabpages With Same Size And Location

Jul 22, 2009

I make 3 datagridview control in 3 tabpages with same size and location, they stack together.I can tick the related datagridview to show such each datagiridview.But when initialize or tab selectedIndex change event, change from dgv to another dgv. dgv display in mess, all border line and color are not shown property.When I resize my main form cause dgv resize, it display fine.

1)Is it bugs for dgv ?

2)I try to run the Main_resize before but also not ok , need to manually regulate the main form size. [code]

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved