|
Yeah, it's called a "menu item". You open your text file, then create items in your File menu from that. There is nothing to do with a "mouseover" event. What's the problem??
|
|
|
|
|
I'm 51 and a total begginer. So things like this take time to stick.
So there is a small problem
But thanks
Regards
Zeldacat
|
|
|
|
|
Cedrickdeorange wrote: So there is a small problem
That's what I'm trying to find out. What's the problem?
|
|
|
|
|
when the mouse hovers on the recent files menuitem, as you know you get a submenu with the list of recent files. how do i get the list to read into the recent files submenu from the text file.
sorry to be a pain in the rump.
Regards
Zeldacat
|
|
|
|
|
Create a menu item under your File menu with a name of, say, RecentFilesMenu and some appropriate Text.
Here's an example of adding submenu items to a menu:
RecentFilesMenu.DropDownItems.Clear()
For x As Integer = 1 to 5
Dim filename As String = String.Format("Filename{0}.txt", x)
Dim newItem As New ToolStripMenuItem(String.Format("&{0} {1}", x, filename), Nothing, AddressOf RecentFile_Click)
newItem.Tag = filename
RecentFilesMenu.DropDownItems.Add(newItem)
Next
You'll, of course, need a method to handle the clicking of those menu items, so....
Private Sub RecentFile_Click(ByVal sender As Object, ByVal e As System.EventArgs)
If TypeOf sender Is ToolStripMenuItem Then
Dim menuItem As ToolStripMenuItem = DirectCast(sender, ToolStripMenuItem)
Dim filename As String = DirectCast(menuItem.Tag, String)
' Call your Load Document code here...
End If
End Sub
|
|
|
|
|
When the program begins you should create menu items and append them to the appropriate menu from the data in the data file.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Can I include code that's in a textfile at runtime in vb.net? I'd like to allow the user to modify the code before the run. Seems like an easy way to do that is to allow them to edit a textfile which becomes part of the code while executing.
Thanks
|
|
|
|
|
I would assume that the basic .NET runtime does not include a compiler.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
No, you can't include code into an assembly that has been compiled already. You can compile the code into a separate assembly and then load that assembly and use classes from it.
Have a look at the Microsoft.VisualBasic.VBCodeProvider class.
---
single minded; short sighted; long gone;
|
|
|
|
|
|
hello i am new in vb.net and i have just started to read about link label chapter and this is the only exercise in that chapter
and when i click button it's not showing any web page but it's shows nice error that application not found
and error is
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in system.dll
Additional information: Application not found
Public Class frmLinkLabel<br />
Inherits System.Windows.Forms.Form<br />
<br />
#Region " Windows Form Designer generated code "<br />
<br />
Public Sub New()<br />
MyBase.New()<br />
<br />
'This call is required by the Windows Form Designer.<br />
InitializeComponent()<br />
<br />
'Add any initialization after the InitializeComponent() call<br />
<br />
End Sub<br />
<br />
'Form overrides dispose to clean up the component list.<br />
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)<br />
If disposing Then<br />
If Not (components Is Nothing) Then<br />
components.Dispose()<br />
End If<br />
End If<br />
MyBase.Dispose(disposing)<br />
End Sub<br />
<br />
'Required by the Windows Form Designer<br />
Private components As System.ComponentModel.IContainer<br />
<br />
'NOTE: The following procedure is required by the Windows Form Designer<br />
'It can be modified using the Windows Form Designer. <br />
'Do not modify it using the code editor.<br />
Friend WithEvents btnVisit As System.Windows.Forms.Button<br />
Friend WithEvents lklURL As System.Windows.Forms.LinkLabel<br />
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()<br />
Me.btnVisit = New System.Windows.Forms.Button<br />
Me.lklURL = New System.Windows.Forms.LinkLabel<br />
Me.SuspendLayout()<br />
'<br />
'btnVisit<br />
'<br />
Me.btnVisit.Location = New System.Drawing.Point(56, 88)<br />
Me.btnVisit.Name = "btnVisit"<br />
Me.btnVisit.Size = New System.Drawing.Size(184, 23)<br />
Me.btnVisit.TabIndex = 0<br />
Me.btnVisit.Text = "Visit Our Web Site"<br />
'<br />
'lklURL<br />
'<br />
Me.lklURL.Location = New System.Drawing.Point(24, 176)<br />
Me.lklURL.Name = "lklURL"<br />
Me.lklURL.Size = New System.Drawing.Size(248, 23)<br />
Me.lklURL.TabIndex = 1<br />
Me.lklURL.TabStop = True<br />
Me.lklURL.Text = "http://www.kidwaresoftware.com"<br />
Me.lklURL.TextAlign = System.Drawing.ContentAlignment.MiddleCenter<br />
'<br />
'frmLinkLabel<br />
'<br />
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)<br />
Me.ClientSize = New System.Drawing.Size(292, 273)<br />
Me.Controls.Add(Me.lklURL)<br />
Me.Controls.Add(Me.btnVisit)<br />
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle<br />
Me.Name = "frmLinkLabel"<br />
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen<br />
Me.Text = "Link Label Example"<br />
Me.ResumeLayout(False)<br />
<br />
End Sub<br />
<br />
#End Region<br />
<br />
Private Sub btnVisit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnVisit.Click<br />
'call the process.start method to open the default browser<br />
'wit a URL<br />
lklURL.LinkVisited = True<br />
Diagnostics.Process.Start(lklURL.Text)<br />
End Sub<br />
End Class
any help for this
waiting for your kind rep.
thanks
|
|
|
|
|
replace this line
Diagnostics.Process.Start(lklURL.Text)
with
Diagnostics.Process.Start("explorer.exe " & lklURL.Text)
|
|
|
|
|
first of thank you very much
but still it's not working it's shows error
and error is
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in system.dll
Additional information: The system cannot find the file specified
waiting for your kind rep
have a nice time
thanks
|
|
|
|
|
I am building a control, within this control is a data grid...The data grid needs to be changed depending on the form that it is on...but when you build a control and then drag it onto a form...you can no longer edit the controls that you placed on that control...any sugestions?
--
"Keyboard not found. Press < F1 > to RESUME. "
Source unknown (appears in many common BIOSes as a real error message)
|
|
|
|
|
Polymorpher wrote: The data grid needs to be changed depending on the form that it is on
The control shouldn't care about what form it's on. It should be modified by the form code only if necessary.
Polymorpher wrote: you can no longer edit the controls that you placed on that control
What does this mean? How do you want to "edit the controls"??
|
|
|
|
|
My control contains a grid control as well as some other controls, when I drag my control onto a form from the toolbox, I want to be able to move the grid within my control and change some of the settings on the grid etc.
--
"Keyboard not found. Press < F1 > to RESUME. "
Source unknown (appears in many common BIOSes as a real error message)
|
|
|
|
|
You're going to have to add code to your control to handle dragging the grid around at design time. The designer won't do it for you because it doesn't support designing constituent controls seperate from the user control that contains them, at the controls runtime.
The properties will all have to be re-exposed as public properties of the user control.
A user control's runtime doesn't begin when the forms project the control is used in is finally run. A User Control's runtime begins when an instance of the control is created on the host form.
From your description, it sounds like it would be better to just break the datagridview out on its own and not have it as a constituent of a user control.
|
|
|
|
|
Hey all!
Got something i need help on.
How can i make a panel's vertical scroll bar to act and control another particular datagrid or another component for that matter.
So when the vertical scroll is moved, both the panel and the other form(eg; datagrid) should be scrolled as well.
Thx in advance!
regards,
Jensen
|
|
|
|
|
You can checkout the response to an article here[^] that describes an alternate method to the articles method.
Either will work...
|
|
|
|
|
Thx dave!
you've helped me one time too many! ur the best.
Regards,
Jensen
|
|
|
|
|
Hello again!
Im' having a tough time to solve this... really need help!
As Dave had pointed out to me this article here[^], i've tried the method suggest by the response to that article and what i've found is that it works when im implementing it to synchronize two richtextboxes....but what it dint' work its when ive tried the same concept to synchronize them with either two data grid / panel / or the combination between both.
Could someone check this out?
Thx in advance!
Regards,
jensen
|
|
|
|
|
I am just starting out with VB 2005 express, and I'm having trouble defining global variables.
I want to use (read and write) the same variables in many different class subroutines, so I want to declare them as global variables.
To do this I created a module called modMain, and defined the variables in the declarations section of the module using script such as
Public strPartNumber As String
Public Const c_ItemNumber As Integer = 1
Public strPartArray (300,5) As String
When I run the code, the program stops at the line within a class subroutine, in which I am trying to change the value of a variable with the command:
strPartNumber = "QQQQ"
The error returned is 'TypeInitializationException was unhandled'
I'd be grateful if anybody could tell me what I'm doing wrong.
Thanks
Andy Scott
Andy Scott
|
|
|
|
|
Is your array definition correct ? It's not const, in any case, so it's not going to be global.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian,
The honest answer is that I believe my array definition to be good, but the program falls over before I reach anything accessing that array.
Do you have any idea why I can't write to the string variable? If I hover my cursor over the variable name, it returns the 'QQQQ' as per the original definition, appearing as if the program is able to read the variable, but not write to it.
Andy
Andy Scott
|
|
|
|
|
Ah... I saw const and thought it was 'shared' ( given that I knew it was not 'static', as in C# ). That's why I said that just some of the variables were not going to be visible, as Dave said, none of them are. That's a weird compiler error tho, when the problem is that the variables are not visible.
I agree with Dave, globals are generally a bad idea. I confess to using them from time to time, tho, for example, I would write a global class to handle settings in ways I consider nicer to what the default MS stuff does. Just proceed with care.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|