Opening A Menu And Putting The Cursor/selection On A Particular Item Programmatically?
Feb 3, 2011
In our application, the customer can work with different client projects/datasets. If there are more than a few client projects to choose from, we display them in a listbox to start with, and then it is easy to preselect the last dataset that the customer was working with. However, if there are only a few client projects, we show them as options in a menu instead (think "recent documents"). When the application starts, I would like the menu to be opened automatically and the most recently used client project selected. Is there a way to open the main menu and a submenu of a form and select/focus (but not actually click) an item programmatically?
The old way that we were doing this in VB6 was to use SendKeys to send keystrokes to the form to open the menu and then arrow-down far enough to get to the most recent project, but that is kind of unclean. Particularly, if the user starts our application and then tabs away quickly to work in a different application, the keystrokes may end up being processed by that application instead.
View 3 Replies
ADVERTISEMENT
Apr 11, 2012
I have a submenu whose items should be selectively greyed out (Enabled=False), and I depend on the parent menu to be clicked. In VB6, from which I'm migrating, dwelling on the parent item with the cursor raised the Click() event, and the submenu items were enabled or disabled in the Click() routine.
In VS 2008 (and I assume probably in VS 2010), the submenu items are displayed as enabled and can be directly selected, bypassing the parent item, by the user even though some should be disabled. If, dispite the apparent availability of ungreyed items, the parent item is explicitly clicked, then the submenu items are correctly initialized. What change should I make to ensure Click() processing occurs before submenu display?
View 8 Replies
Jul 25, 2009
How do I make a menu item on a menu strip link to another windows form (like a menu item that links to an about page already created in the project). I know that every coder knows how to do this, but i've read most of the instructions in the world for Visual Basic coding, but can't find ANYTHING I know coding fairly well, so I can modify it, but I can't create it my self.
View 4 Replies
Jun 22, 2009
i want to show context menu on drop down menu item right click...As an example,Suppose we add bookmark in mozilla & when we right click on that item..context menu is showing
Code:
Private Sub MenuAddToFavorites_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MenuAddToFavorites.MouseDown
If e.Button = Windows.Forms.MouseButtons.Right Then
[Code]......
View 5 Replies
Jun 1, 2010
I have a MenuStrip with many submenus. I want to rearrange some of the menu items by making several of them submenus to another menu item.[code...]
View 2 Replies
Jun 22, 2010
I have a VB form with 2 comboboxes and a textbox in which a user can type into.I would like my mouse cursor to move from my 2nd combobox selection directly over to the textbox that I have on a VB form.2nd comboboxe name: "CodeComboBox"Textbox name where I would like my cursor to move to after the selection:"USDOTNumtxt"I use the TextBoxName.Focus() in the SelectedIndexChanged but it doesn't function.
Here is my whole code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
[code].....
View 1 Replies
Dec 12, 2011
RichTextBox1.SelectionBullet = True
SendKeys.Send("^+{L}")
RichTextBox1.SelectionIndent = 10
using the above for numbering in richtextbox, how I can trace if the cursor is in the selection.start which is in the place where numbering is there...
View 1 Replies
Nov 18, 2010
I have a list of items in a ListView and at the top of the list there is an item that is supposed to select all the items in the ListView. I can get it to select all of the items when it's checked but then I can't deselect any other items. I need the to know which item was checked, when putting the sender into a message box I get "System.Windows.Forms.ListView, Items.Count: 1, Items[0]: ListViewItem: {All}". How do I get the sender's item?
View 6 Replies
Sep 30, 2011
I have a text box with some text inside it;
the text is long (say 100 chars);
the textbox can display about 20 chars.
The following code:
tbxTest.SelectionStart = 5
tbxTest.SelectionLength = 60
selects a part of the text and sets the cursor (blinking beam) at the and of the selection, in this case the first caracters of the selected text is out of the user sight because the textbox is too small to display the entire selection.
Is it possible to force the cursor to be at the beginning of the selection so the first part of the text is visible? (as if I had selected my text with the mouse dragging from the end back towards the beginning)
View 7 Replies
Feb 22, 2009
I've a problem with DataGridView component when trying to set the value of the CurrentCell. What i'm trying to do is :
I've a DataGridView With values. I want to make a button in my forms and when clicking on it I want to change the selection from the current row to the next. To explain more, by clicking my Button I want to simulate the effect of a mouse click on a DataGridview.
View 5 Replies
Oct 8, 2010
i need to togglie selection form a string in a rich text box and put careet one space forward.
View 1 Replies
Apr 21, 2010
I know how to add menu separator in under UI, but how can i add it programmatically.
View 3 Replies
Jun 1, 2009
In my vb.net app (windows),with this code word document is not opening with menu bar,tool bar etc[code]...
View 1 Replies
Jun 6, 2011
I'm looking at modifying an application we use in the office, the program links to the phone system and allows us to cross caller ID with our database and dial numbers from the database.What I'm trying to work out is how to add a selection to the generic windows right click menu. ie I want to mark a phone number in say ie or word and 'right click' and be able to click 'dial' from the menu. What are these menu's called and can i access its components from VB?
View 2 Replies
Nov 21, 2011
I have created a form with a menu-strip containing sub-menus. The sub-menus will open on clicking the menu items but I am willing to display the sub menus on moving the cursor on menu items(mouse-hover). What will be the code for this? Is there any property in menu-strip to display like that?
View 1 Replies
Feb 1, 2010
How to change the system's cursor using VB.NET?
View 1 Replies
Feb 1, 2010
How to set the cursor of a windows form using VB.NET?
View 1 Replies
May 20, 2011
When I use the Publish command in the Build menu pillar nothing happens expcept for a few seconds showing the wait cursor. This was working a week or two back but I have now installed sp1 for Visual Studio 2010 - is this a bug or is there some way. I can get this working again. I cannot access the project properties either, which is a known problem with SP1, so how to edit the project.vbproj file.
View 2 Replies
Jun 8, 2012
VB.NET Winforms Application... When a user starts typing in the search box of the application it automatically populates the name list dropdown box with the valid results and sets the droppeddown value to true... Everything is working fine except the fact that the user is forced to select a value from the name list or press the esc key because without doing so the mouse cursor just disappears and you have to move the mouse all the way outside the application for it to come back and it will only do so while outside the applicaiton.. Below is the code that I am using for this and it should be noted that I am using the droppeddown value else where in the application and none of those instances have an issue its only this one..
Private Sub u_lastName_Box_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles u_lastName_Box.TextChanged
u_nameLook_Box.Items.Clear()
[Code]....
View 1 Replies
May 15, 2010
VB express 2008 .net 3.5 or .net 4.0 VB express 2010?I have written application to convert RTF to HTML. The main Purpose of the application is to copy VS code to the clipboard and covert it then put it back into the clipboard as a HTML Document so that it can be pasted into a HTML document such as Windows Live Mail. I found that code copied and pasted is spaced out in in the wrong positions.
The applications works perfect with no bugs so far. I then asked Myself how to go about doing the copy with the least amount of operator interaction. So I added an Icon to the Icon Tray with a right click menu to use to convert once the Rich Text Format was copied to the clipboard. This works fine except you have Five steps, Select the text, Copy to clipboard, Right Click the icon, Select the Converter and Paste. The normal is three steps.
To this the best solution is to add a context menu item to the active form such as the RTF editor or window. So that when you select the Rich Text to copy and right click on the form to bring up that menu then to Just Select the menu Item such as "Copy RT and Convert" I searched and found about 544000 Items and tried to restrict down to no avail. I read until I finally gave up. I did not find any code examples of this. Almost every thing I found related to the web or some other explicit document like Excel and not to the Various windows that could be active with RT in it.
how do you add a context menu item to the context menu of an active rich text format window such as WordPad or VB?I have test in my application that tests to see if it is a RTF in the clipboard so if it is not the converter does nothing.
Imports System.Threading
Imports System.IO
Imports System
[code]....
View 8 Replies
Sep 8, 2011
I'm having an issue wherein after I run a search filtering a datagrid, the corresponding datadetails will not update anymore when a new item is selected in the datagrid.I would like it so after clicking an item in the datagrid, the details update automatically.
[URL] The problem is, after running a search (or hitting 'show all') the label/details no longer change when selecting a new item in the datagrid.[URL]
Private Sub Sheet1BindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Validate()
Me.Sheet1BindingSource.EndEdit()
[code]....
To clarify, the search itself filters the datagrid perfectly as intended....it just seems to stop the details from updating when new items are selected which is my problem.
View 5 Replies
Sep 18, 2011
I have four comboboxes in my Ist form related to course as.c_type,c_stream,c_major,c_nature.......combobox c_type contains the type of courses like degree,diploma, PG etc,similarly "c_stream" contains stream like engg,medical etc. further c_major contains all courses like computer engg(CE),mechnical(ME), physiotherapy etc. and last c_nature has course nature whether regular or private or distance.Now situation is when i select diploma from c_type, corresponding options must be populate in c_stream like engg. And now when i select engg., CE or ME must be there in c_major combobox .Same is for C_nature.The all 4 combobox must show "please select" text on form load event..i also have 2nd form where i have same combobxs. so is there any way to call the same code without again writing that to 2nd form.
View 1 Replies
May 17, 2010
I am attempting to import items from a legacy issue tracking system stored in an Excel sheet into Team Foundation Server. I loop through the rows of the Excel file successfully, and I can create new work items, but they are always in the Proposed state. If I attempt to change the state to Closed, then call the Validate method for the work item, I receive a validation error on the State property - InvalidListValue{4}.
Dim MyProj As Project = store.Projects("MyProject")
Dim WIT As WorkItemType = MyProj.WorkItemTypes("Task")
Dim WorkItem As WorkItem = WIT.NewWorkItem()
[Cdoe]....
this is a CMMI task that I am trying to create and close. I wonder if I'm trying to skip over certain activities required by CMMI
View 3 Replies
Jan 3, 2012
I had a DataGridView, and already able to add DataGridViewComboBoxColumn to it. It read data from database StoredProcedure using custom ValueDescriptor class, this is the code for it:
Shared Sub fillComboBoxCellUsingSP(ByVal comboBox As DataGridViewComboBoxColumn, ByVal proc_name As String, ByVal param As Object(), ByVal firstitem As String)
Dim dt As New DataTable
[Code]....
Actually, the line that read comboBox.Value = o is okay. But still, the combo box cell didn't display the value. Just empty. And sometimes, DataError event raised.
View 1 Replies
Jan 6, 2010
I already have one year experienced in c++, and built many private applications.My question is simple to ask, and simple to answer I think.When I select an item in a listview, I want the full item to be selected. Now only the TEXT in the listview item is selected. I've made a picture to clearify my problem.The picture in the link below is splitted up in two pictures. It shows what I currently have, and what I want (my aim)
View 4 Replies
Jul 19, 2011
I want to select many items from the listbox in vb .net i. e i have the following code:
For i As Integer = 0 To Me.lstdep.Items.Count - 1
If dt.Rows(0)(3).ToString.Trim = Me.lstdep.Items(i).ToString.Trim Then
lstdep.SetSelected(i, True)
End If
Next
running the above code i can select only a single item from the sql server 2005.But i want to select multiple items which are seperated by comma in the back end ....
View 2 Replies
Jun 12, 2011
Having some issue trying to programmatically check items in a CheckedListBox.What i am trying to achieve:
1. Pull Staffnames from database
2. Separate each staff member via delimiter
3. checked = true for each item in StaffCHKlist where staffnames = existing StaffChKlist item
i have had a few goes, but cant seem to achieve, this is where i am currently at:
Dim sl As String = ds.Tables("Consignment").Rows(0).Item("StaffName")
Dim tokens As String()
tokens = sl.Split(",")
[code]....
which errors with:
"List that this enumerator is bound to has been modified. An enumerator can only be used if the list does not change."
I have been trying to understand, would programmatically checking an item in a checkedlistbox be classified as list change?
View 1 Replies
Mar 27, 2009
how to "programatically" set an active cursor within a datagridviewcell?my requirement is, when a row is selected in a datagridview control, the corresponding "Value Column" textbox cell goes into edit mode.the DataGridViewTextBoxCell object as a "IsInEditMode" attribute, however, no obvious way to put that cell into edit mode.
View 1 Replies
Aug 4, 2009
a dialogue box to have the user open a file they wish. I'm trying to open a specific file when a listbox item is selected and I have that down but I'm running into the problem of needing to have "" in the display which is impossible from what I can tell in the code. I just need to know what goes in the quotes which will open the file. Also lets say the text file was 'supportdoc1.rtf' and was located in a folder inside of the program folder called 'SupportDocuments' would the path be "SupportDocumentssupportdoc1.rtf" [Code]
View 10 Replies
Nov 30, 2011
I've worked out how to create a DropDownList using the following code: <select id="salesPersonDropList" runat="server"></select> In my .aspx page, then my code behind loops through database output running:
Dim newListItem As ListItem
newListItem = New ListItem("Title", "Value")
salesPersonDropList.Items.Add(newListItem )
What I can't figure out is how to programatically set which of the List Items created is the one to be pre-selected in the rendered DropDownList, ie, how to create what I'd write in HTML as:
[Code]...
View 3 Replies