vb.net: keep form always keep back and never got font by click - vb.net

I want to make a desktop item manager program using vb.net.
I hope to create a form there and use the menus etc. to make the desktop icons work.
You want to set the form to always be behind the other windows. Like a widget.
How to do this?

Related

How to keep MS Access Forms only in the MS Access Window/Canvas?

I have created my MS Access Program but I have multiple monitors and so do the other people who will be using the program.
Just so you know my forms are popup style, have no borders or record selectors and I am guessing this is where my issue comes in.
I would like to know if there is a way to ensure that when a user opens a form, the form will only open within the MS Access Window/Canvas on the active monitor?
I would also like to know if there is a way for my application to automatically adjust according to the users screen resolution?
As an example my Forms open perfectly when I am using the application on my main screen which has a resolution of 3840 x 2160 but if I open the application on my second screen which has a resolution of 1920 x 1080 the forms that open subsequently, such as the user form, then opens on the main screen so small that no one can read or see it.
Application is on Right monitor and User Form is Open on Left (Main) Monitor
The code I have used for the OnOpen Event is below:
Private Sub Form_Open(Cancel As Integer)
Dim Right As Integer, Down As Integer
Right = Screen.ActiveForm.WindowLeft
Down = Screen.ActiveForm.WindowTop
DoCmd.MoveSize Right, Down
End Sub
This was obtained from some research but I cant seem to bind everything to the Application Window/Canvas.
Thank you.
Well, if you only ever have one window open at one time, then you can do this with ease.
Remember, today most applications are SPA (what we call single page applications). We don't use (nor have) very often a main applcation window, and THEN a child window. For one, they tend to not be touch friendly, and it is VERY hard to move a window around with touch.
but, even desktop browsers even use some "kind" of tabbed interface. And so do most desktop applications. And by tabbed - I don't necessary mean across the top. This access screen shows a tab system from the left side:
So, Access now has a option to use tabbed interface.
And if you :
do NOT use pop windows.
Set access to use tabbed interface, eg this:
Then un-check the display tabs.
If you do above, then you WILL NEVER EVER see the access background window.
You see this:
However, keep this in mind:
The form you launch will re-size to the main size of the Access window - not the other way around.
All forms can't be popup
You are "SPA" like applcation.
So, most accounting and most desktop applications now work this way. And WHEN you launch a form, the window does not re-size tot he form, but remains the current applcation window size.
So, without ANY specials code, you can 100% hide the access background window.
And if you re-size the access application window, then the form will re-size to fill out the current form.
This might look quite bad in some cases - such as this:
Now for above, I on purpose made the form background green - just to PROVE and show that that Access background window NEVER will display with above options.
So, the main issue here?
You can 100% hide the access background window. And you can now do this WITHOUT specials code. Just a few settings.
On startup, you can hide the ribbon - or build a custom one - again your choice.
But, your forms MUST NOT be popup forms anymore.
So, hiding the access background window is very easy - it then becomes a question of form size - size forms re-size to application window size - not the other way around.
On the other hand, if you adopt a tabbed interface (accross the top or left side), then your main window is always in display, and you are in effect swapping out the form (a sub form) for display of that given form. You can write your own code, or use a new navigation form - which does this for you).
If you need to launch separate windows, then you could launch them as popup from this main form - but that main form will of course always hide the access background if you follow above.
If you wish to hide the ribbon, then on your main form - load event, you can add this code:
DoCmd.ShowToolbar "Ribbon", acToolbarNo
So, your main form (which hides access background) could be tabbed inteface (SPA) or it could be a launcher form, and each option clicked on could launch a form as popup - which can be dragged anywhere on your computer - including to the 2nd monitor if you wish.
So, either forms stay always in the main applcation window - but never see the background. Or you use above, and launch forms as popup.

Showing Tool-tips while Application is in the System Tray?

In my application when it is iconized in the system tray, and through a ContextMenuStrip1 displays a context menu and when I click the icon I can choose what to display; the application, close it etc.
Now, when the mouse is over the icon I would like to show a tooltip (property that unfortunately does not have, but that have the individual menu items), it always shows me the name of the menu object: ContextMenuStrip1, even in its text property set something else.
Since at some times the app makes updates in background I would like to show under the icon a small progressbar as do some application. How is this possible in vb.net? (I'm using VB2012)
Thank you all.
I resolved you need to use the Text property of the notifyIcon object.

Is there a way to locate a code block from a GUI in debug mode?

I'm digging through a program that contains a lot of forms with names that aren't as descriptive as I'd like them to be. I am trying to edit some motor control functions, and in the GUI I am able to reach the form that contains buttons controlling the motor, but I'm not sure where the code is that controls this form. Is there a way to open up the code block corresponding to the form I navigate to from the GUI in debug mode?
Or, alternatively, how can I navigate through the GUI without running it? I know I can right click and do "View Code", so if I could navigate to the form I'd be able to that.
I am using VB.NET in Visual Studio 2010
Go by button text. In visual studio search(Ctrl+F) using the text, visual studio will find the designer.vb file holding the button with the text, once it is done try to look at the design of particular then you can figure out which form you need to look at.
thanks

MFC Custom Keyboard DLL Accessed from Application Dialog Box

The overall goal is to be able to access a pop-up keyboard through an application that I am making in MFC.
I have created a dialog box with an empty text field. I would like to be able to click the empty field and have an onscreen keyboard to enter in the data field.
Is there list of functions or tutorials that anyone can provide me with to be able to perform this function? Ultimate I will be making the keyboard from scratch, so any guidance would be useful.
My first thoughts (I might be wrong someone might correct me if i am wrong.)
1)Create your Keyboard Ui in an MFC DLL and export the KeyBoard Functions like LaunchKB(Int screenx,int screeny) and CloseKB()
functions.
2)I would subClass CEdit and CRichedit such that when the edit control gains or loses focus it would call LaunchKB() function with windows ScreenX coordinates where the keyboard has to be displayed or CloseKB().
3) A callback function registered to dll ,which would get called for every click on the keyboard with characters clicked and these characters are to be displayed in the edit control.
This is just my thought ,there may be better ways to implement as well.

How to Control where a form loads

This is going to be the first of many questions I am sure.
I am starting to create an application in VB.net and I am not super familiar with the language yet. I am trying to design an application based off of a system tray icon and by that I mean, when you launch the application, there should be no initial form that loads, just the icon in the system tray.
From there I need to do two things. I would like "on mouse-over" to pop-up the form right above the system tray and "on double-click" have it open in the middle of the computer screen.
I am successful in using "static" placement {Me.Location = New Point(800, 390)}
I can get the windows/forms to open where I want them to, but the problem is when I change to a different computer they don't open in the correct location. I need a way to make sure the forms open in correct location no matter the screen resolution.
Can anyone recommend what I should Google to learn more about form placement or maybe even a link. Being so new to the language, my Google attempts have failed and I am needing more direction and a little hand holding until I get the terminology down and an idea of what I am looking for,...
If you want to dynamically place your form based off the desktop size, check out:
SystemInformation.VirtualScreen.Width
SystemInformation.VirtualScreen.Height
...and move your form based on these dynamic values. e.g.
Me.Location = New Point(SystemInformation.VirtualScreen.Width - Me.Width, SystemInformation.VirtualScreen.Height - Me.Height)
For more information about VirtualScreen, check out MSDN:
http://msdn.microsoft.com/en-us/library/system.windows.forms.systeminformation.virtualscreen.aspx
VirtualScreen will give you the combined size and width of multiple monitors, so as an alternate, you could also simply look at the primary screen, e.g.
Screen.PrimaryScreen.WorkingArea.Width
Screen.PrimaryScreen.WorkingArea.Height
you can use Me.CenterToScreenTo center it to the users screen and as far as i know that is the best you can do
In form properties there is a property StartUpPosition set it to CenterScreen