VS 2008 How To Make ToolStripMenuItem Persistent

Feb 23, 2010

here is what i want to do have a ToolStripMenuItem in a ToolStripDropDownButton menu what i want to do is have an option to not hide the menu when the ToolStripMenuItem is clicked so i wrote the following:

[Code]...

View 3 Replies


ADVERTISEMENT

Make Graphic Persistent In VB And GDI+?

Sep 24, 2010

I have a converted VB6 App that would draw irregular shapes on a PictureBox when I click on a button, and these irregular shapes would persist until I either close the App or erased the PictureBox to start the display anew.I converted my App to VB.Net to do the same, i.e. draw on a PictureBox again, but the drawn lines appear briefly and then, at the end of the drawing process, when my App returns control to the Operating System in wait for another event, the graphics disappear as if erased by the App (which I don't do of course).I have created a Graphics Object associated to my Picture Box as:

Dim CurrGraphics as System.Drawing.Graphics
CurrGraphics = PictureOut.CreateGraphics

I then use the DrawPolygon and DrawLine methods to add the irregular shapes I want:

CurrGraphics.DrawPolygon(CurrPen, Pts)
CurrGraphics.DrawLine(CurrPen, Pts(I).X, Pts(I).Y, Pts(I+1).X, Pts(I+1).Y)

where CurrPen is a defined Pen, and Pts is the Points() array with the coordinates of the displayed shape. Several dozens irregular shapes are drawn and then the subroutine stops, and returns to waiting for another request from the user.What could be the prime reason why graphics do not persist in a PictureBox, and are erased immediately after they are created ?

PS: I do not use the PainEvent of the PictureBox PictureOut, as in the example given in the VB documentation (below), as the display process is initiated by clicking on a button, and I cannot relate how to transfer control to the PaintEvent as below:

Private Sub Form1_Paint(sender As Object, pe As PaintEventArgs) Handles _
MyBase.Paint
' Declares the Graphics object and sets it to the Graphics object

[code]....

View 10 Replies

How To Make Persistent Application Setting

Dec 7, 2009

I have an application that has two states based on the value of a Boolean variable: a read_only=true state and read_only=false state. The value of this state is stored in an external settings file. My application has a feature called deploy that generates a copy of itself in the same folder with the read_only=true state. But, the read_only variable value is stored in an external file so now both files will be in the read_only=true state. What I want to do is make one of them(the original one) always be read_only = false and the other read_only=true

View 3 Replies

Make ToolStripMenuItem?

Jan 30, 2011

I have mainform which has a menustrip and it contains many level of menuItems every thing works fine, but my question is when I display the form form any MenuItem by the click event and when I close or dispose the called form it dose not display where thelevel where it was called from, instead it come back to the top level menu and no one is selected.

View 5 Replies

Loop Through Toolstripmenuitem Child Of Toolstripmenuitem?

May 26, 2009

i want to loop through toolstripmenuitem child of toolstripmenuitem but i dont fine yet :

For Each mnu As ToolStripMenuItem In Trangchu.MenuStrip1.Items
For Each mnu2 As ToolStripMenuItem In mnu ( red word is error ) Please show me)
MsgBox(mnu.Text)
Next
Next

View 15 Replies

VS 2008 ToolStripTextBox And ToolStripMenuItem

May 15, 2010

I have in a menu a ToolStripTextBox where the user can enter a CASE NUMBER to FIND. And I have a ToolStripMenuItem below that says QUICK FIND - clicking this will find the case you put in the textbox. Tabbing out of the textbox puts you at this TOOLSTRIPMENUITEM so that ENTER on the keyboard will trigger the FIND. I want to make it so that pressing ENTER while still in the textbox will trigger that same TOOLSTRIPMENUITEM action. Do I have to trap keypresses or is there a more natural way to accomplish this?

View 6 Replies

VS 2008 Find Parent Of Toolstripmenuitem

Jul 18, 2010

I'm developing an application which is having Menustips with few elements. My structure is as follows;

Add-on Modules
|_ Data Export
| |_ Back Office export

[Code]....

I set the visibility in each leaf element as per the permission given in DB. But I want to set visibility=false in case all the leaf elements are set to false.

e.g If POS interface and Backoffice Interface are set to False, Then I need to hide the Parent (Interfaces) too.

View 5 Replies

VS 2008 Weird Error With A ToolStripMenuItem?

Jul 5, 2011

I had a lengthy subroutine with handler routines, like this, before:

Private Sub CompMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _
ToolStripMenuItem3.Click, ToolStripMenuItem4.Click, ToolStripMenuItem5.Click,

[code].....

View 3 Replies

VS 2008 Adding ToolStripMenuItem Array To MenuStrip?

Apr 28, 2010

I have this

Dim oLanguages As SortedList = Languages() 'Languages() is my custom Function
Dim oLanguageMenu(oLanguages.Count) As ToolStripMenuItem
For n As Integer = 0 To oLanguages.Count - 1

[Code]....

The last line produces an error: "value cannot be null. Parameter name: value".

View 3 Replies

VS 2008 Storing Custom ToolStripMenuItem Data

Mar 16, 2010

I'm trying to add functionality to my application to let user define "custom actions" in one of the context menus.Essentially, these would be command lines that can be executed against remote machines.I've got the code to add the menu items working but I'm not sure of the best of storing the data related to the menu items. At the moment I'm using a Specialized.StringCollection in the project settings but this only allows me to store a single line (i.e. the command line).This means that the text of the menu items is whatever command line the user has defined (not ideal).What I would like is to have a "friendly" name for the menu item (e.g. Start Notepad) and have that associated to notepad.exe.What's a good way to store this data so that I best dynamically build the menu items every time?

View 3 Replies

VS 2008 Way To Specify Index Of A ToolSTripMenuItem In MenuStrip When Adding It

Sep 1, 2010

Is there a way to specify the index of a ToolSTripMenuItem in a MenuStrip when adding it so that it does not get added to the end of the list?[code]

View 2 Replies

Making Settings Value Persistent?

Sep 19, 2011

how to make the settings in my app persistent When i save in the previous run using this

my.Settings.setting_name= some_value
my.Settings.save()

when getting the values using this

some_value=my.Settings.setting_name

i still see the old values in the IDE settings options.How can i make the changes reflect even in the vs ide

View 1 Replies

Usercontrol Properties Not Persistent?

Jan 31, 2011

i've created a usercontrol in a win forms project + the properties work as expected, but when i recreated my usercontrol as a win forms usercontrol class library, the properties changed at runtime aren't persistent.i tried adding a DesignerSerializationVisibility attribute to the property but that didn't work.

View 2 Replies

Create Persistent Graphics On Top Of An Image?

Mar 1, 2011

I am building a program which offers solutions to the travelling salesman problem (finding shortest tour between a set of cities while visiting each only once).

My program loads a bitmap image of a map into a picture box. From there, graphics which point out the cities as well as tour paths are drawn onto the map. My problem is that when the option to plot ALL cities is enacted, the user may choose to pinpoint a specific city with a separate control. When the user erases that pinpoint via an invalidation routine, though, it erases all graphics beneath it, which is undesirable. How can I make my tour graphics and city plots semi-permanent by drawing them directly on the image? I tried drawing them on a separate bitmap, but it 'covered up' the map image.

View 1 Replies

Persistent File Change Within An Executable?

Jan 25, 2011

I was wondering if it is possible to have persistent changes to resources in an executable. I am using VB 2010. I don't know how to be much clearer than that but I will try.

> User opens program and picks 'File A'

> 'File A' is now copied into the executable, thus storing it forever (or until deletion of .exe

> .exe is now slightly larger because 'File A' is inside the program

> User can extract or delete 'File A'

View 2 Replies

Storing Persistent Objects In VB Application

Aug 31, 2011

point me to the best way to store persistant objects ( of my own class) in a vb application? I am putting together a simple family recipe application and have created a food item class. I would like to store the instances ( food items) indefinately so that they are there each time I start the program complete with all properties and meethods

View 14 Replies

Using My.Settings.something To Store Persistent Data?

Dec 27, 2011

You know how using My.Settings.something to store persistent data is done only for user settings and not application settings. This information is stored in the registry on the local user section.My problem here is that even if it is in the same machine, when a user changes some setting it is not reflected on other users. This is desirable for some of them but there are a few I would like to keep for all users.Is there a way to do it with the settings? Do I need to write to the registry in the machine section? or do you just recomend I create a configuration file?

View 5 Replies

Asp.net - SrReader.GetValue(1) - Persistent Data Flow

Apr 19, 2012

I am very New to Vb.net. We are using fortify software for projects when it is going to LIVE. In that process I got some cross-Site Scripting : persistent Data flow issues.

[Code]...

View 1 Replies

Click Event Temp Values Remaining Persistent?

Dec 13, 2010

I'm trying to create a version of the game Spill and Spell. I'm having problems with a click event for Labels that is supposed to exchange the .Text value stored from the previous mouse click with the current .Text value on the new Label clicked. The labels are initialized and stored in an array on the form load.

What's happening is that the values are remaining persistent to the label being clicked.

Desired Results (example):

User clicks on lblDice1 (sender), tempLetter is set to mouseLetter.CurrentLetter, mouseLetter.CurrentLetter is set to lblDice1.Text (sender.text), lblDice1.Text is set to tempLetter. (this part works)

User clicks on lblDice2 (sender), tempLetter is set to mouseLetter.CurrentLetter (s/b initial .Text value from lblDice1 above), mouseLetter.CurrentLetter is set to lblDice2.Text (sender.text), lblDice2.Text is set to tempLetter.

What's Happening:

The tempLetter and CurrentLetter values are remaining persistent to the Label being clicked on. Ie: lblDice1 click will only display the original text associated. If I click Dice1 then Dice2 and then Dice1 again, the original Dice1 text is displayed (same for Dice2).

This is a lot easier to see. All of the controls with the exception of a button ("btnStart") are defined in the code below. Click the Start button to show values in the DiceLabels grid.

The area that's the problem is Public Sub DiceLabel_Click

(this is a work in progress...)

[Code].....

View 8 Replies

How To Know Parent Of A ToolStripMenuItem

Mar 5, 2011

I want to know is parent of ToolStripMenuItem a MenuStrip or not?

View 8 Replies

Change Toolstripmenuitem Forecolor?

Apr 2, 2010

I have a custom toolstrip renderer, which works perfect. But I want to change the forecolor of the toolstripmenuitems too. How can I achieve this?This code should be completed:

Public Class mymenu
Inherits Windows.Forms.MenuStrip
Public Sub New()[code]......

View 3 Replies

Determine If This Toolstripmenuitem Exists?

Aug 27, 2010

Below is the code that is adding a toolstripmenuitem at runtime. I do need to check elsewhere to see if it exists. What I have below is incorrect. How would I change the conditional check below?

ToolStripMenuItemFile.DropDownItems.Add("Save")
ToolStripMenuItemFile.DropDownItems(2).Click += New EventHandler(SaveFile_Click)
If ToolStripMenuItemFile.DropDownItems(2) IsNot Nothing Then
ToolStripMenuItemFile.DropDownItems(2).Text = rm.GetString("Save")
End If

View 2 Replies

How To Detect When ToolStripMenuItem Clicked

Jul 1, 2010

I want my program to detect and do something when ToolStripMenuItem is clicked.

View 1 Replies

Set ToolStripMenuItem(s) Color On Load?

Jan 19, 2010

I'm trying to find a way to set the color of my toolstripmenuitems on form_load. Been trying something like:

For Each menu As ToolStripMenuItem In Me.Controls
menu.BackColor = clr
Next

I know that Me.Controls is probably wrong, can't find a proper way though.

View 1 Replies

Setting Position For ToolStripMenuItem

Apr 12, 2012

Am facing the below issue while converting my application from vb6 to vb.net.[code]The menu is getting displayed always at the top left. I need to set it exactly as wher I right click.

View 2 Replies

ToolStripMenuItem - How To Modify Loop

May 6, 2010

I have this:
For Each oToolStripMenuItem As ToolStripMenuItem In oToolStripMenuItemMain.DropDownItems
'...
Next
First line produces an exception because it runs into a ToolStripSeparator. How to modify this loop so it won't?

View 2 Replies

ToolStripMenuItem Click Event?

Jul 7, 2011

I am having trouble figuring out a way to add click events to ToolStripMenuItems generated off data from a ListView object.In short, i have a ToolStripButton called 'View', in that i have a ToolStripMenuItem called 'Group'- What i have already accomplished is adding sub-items to the 'Group' ToolStripMenuButton. These items are based of ListViewGroups inside of my ListView.

Here is the code for what i've done so far:

Code:
Private Sub ToolStripButton3_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripButton3.MouseEnter
'LOAD GROUPS INTO MENU LIST
GroupToolStripMenuItem2.DropDownItems.Clear()

[code]....

As you can see, this will generate a ToolStripMenuItem inside the 'Group' ToolStripMenuItem for each group that is located inside my ListView- as well as add a constant ToolStripMenuItem, 'All', for viewing all groups again.What i am unsure on how to do is program in the OnClick Event for each of the generated ToolStripMenuItems?

View 2 Replies

.net - Bind To The Enabled Property Of A ToolStripMenuItem

May 31, 2012

I'm trying to do MVP where I have a view specific model that the presenter manipulates and the view binds to. There is no other connection between the presenter and view (the view fires off commands to the domain model via a gateway type pattern).

As you can guess, this makes the ability to bind to any property of any object really important.

I'm having trouble finding the correct way to bind to the Enabled property of a ToolStripMenuItem. Most controls have a .DataBindings property, but this one seems to lack it. I haven't found much info online about how to do this. Is it even possible?

View 1 Replies

.net - SourceControl Of ContextMenuStrip Is Nothing In ToolStripMenuItem Click?

Jun 22, 2010

I have single ContextMenuStrip attached to more controls.In use the Opening event of ContextMenuStrip to filter/disable some context entries.In this case the property ContexteMenuStrip.SourceControl is set correctly.The problem I have is on the Click event of a ToolStripMenuItem. This item is inside a ToolStripDropDown. I get the parent item with code:

Dim tsmi As ToolStripMenuItem = DirectCast(DirectCast(DirectCast(sender, ToolStripMenuItem).Owner, ToolStripDropDown).OwnerItem, ToolStripMenuItem)

[Code]...

View 3 Replies

Change Color Of A ToolstripmenuItem When It Is Selected?

Feb 13, 2012

How do you change the color of a toolstripmenuItem when it is selected?

When Clicked on to open up the drop down menu.

I can change the Background for everything else, but when I click on the toolstripmenuItem the dropdown shows up correctly but the MenuItem changes to an incorrect color.

View 1 Replies







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