|
Why not use a normal menu. I thought the only real difference is that the context menu is attached to a control and is available on the left mouse click. Wrong tool maybe!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Found I can do what I'm doing with the contextmenustrip. Thanks anyways!
Any suggestions, ideas, or 'constructive criticism' are always welcome.
modified on Sunday, October 12, 2008 8:50 AM
|
|
|
|
|
I have an application in which i need to search for the files in a directory and list them in a listbox. Could any body tell how to do this using vb.net 2005. I am new to vb.net.
Thanks in Advance.
|
|
|
|
|
hi,
use following statements for get files from particular directory
If Directory.Exists(Application.StartupPath & "\ABC") Then<br />
Dim ob As New DirectoryInfo(Application.StartupPath & "\ABC")<br />
<br />
Dim file_infos() As FileInfo<br />
file_infos = ob.GetFiles()<br />
<br />
For Each file_info As FileInfo In file_infos<br />
Listbox1.Items.Add(file_info.FullName)<br />
Next file_info<br />
End If
hope this helps
|
|
|
|
|
Thanks Rupesh for your reply. It realy helped. Thanks once again.
Sekhar
|
|
|
|
|
hello everyone...
please give me some hint how can i load cv or resume with any format in a database using vb application or using any language..
thank you in advance...
jyn
|
|
|
|
|
If you are using SQL Server 2005 or higher then put it in a varbinary(max) column.
|
|
|
|
|
I am using ORACLE 10G...tnx for the reply...
jyn
|
|
|
|
|
In Oracle use Blob as datatype at database and OracleLob class to handle it in the application.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
thanks mika for your reply...
i'll try it..
jyn
|
|
|
|
|
thanks for the reply...
but what i need is to load not the whole file.
for example..when i upload a cv or resume.. i can save only the name and address of the person.
jyn
|
|
|
|
|
Now I don't understand. Do you want to store in the database:
- only some information about the CV
- or the whole document as binary information.
If it's the first one, you set up a table containing fields for each information (name, address etc) and then extract the info from the CV. If you want to understand the CV programmatically, there is no general way to do this.
If you want to store the whole document, use LOBs as I suggested. Refer Oracle LOBs[^] for more info.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
thanks for your reply mika..
the first one is what i need... do you have any idea how can i extract the info from the cv??
like getting only the name, address of the person from the cv(any format)
thanks again.
jyn
|
|
|
|
|
As I said there is no general way for this.
If you cannot force the CV to some specific format (like using an asp page), it's just a document.
If you have an idea how you would know what is name and what is address and so on, you can use that info. Otherwise it's just text in some format (rtf, doc, txt etc). So the question is, how would you know for example the name of a person.
Take my name as an example. How would you recognize in the text that it's a name and not for example address or something else? In this forum you can recognize it since it's in sender info so this site forces some information to a specific format.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
am trying to draw rectangle but it is drawn just with a single click (with different lengths and widths) also it is going out of pictureBox area But i want it to start from where mouse key is pressed and end where mouse key is released. i think there is something wrong with my quardinate. Waiting for reply.
Thanks
[code]
Dim x1, y1, x2, y2 As Integer
Dim MD, MU As Point
Dim mywidth As Integer
Dim drawtool As String
Dim drawpen As Pen
Dim g As Graphics
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
MD = e.Location
x1 = MD.X
y1 = MD.Y
End Sub
Private Sub PictureBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp
If e.Button = Windows.Forms.MouseButtons.Left Then
MU = e.Location
x2 = MD.X
y2 = MD.Y
DrawRectangle()
End Sub
Public Sub DrawRectangle()
gr = PictureBox1.CreateGraphics
Dim solidColorBrush As SolidBrush = New SolidBrush(Color.Red)
Dim coloredPen As Pen = New Pen(solidColorBrush)
coloredPen.Width = 3
coloredPen.Color = Color.Blue
Dim drawArea2 As Rectangle = New Rectangle(x1, y1, x2, y2)
gr.DrawRectangle(coloredPen, drawArea2)
gr.Dispose()
End Sub
[End code]
|
|
|
|
|
I have a windows service that I'm currently writing that will start automatically when the server that it is installed on is rebooted.
The service will look up some data on a SQL table and then close the database and continue working without opening SQL again.
This should work fine with one exception. What happens if the MSSQLSERVER service hasn't started yet?
What is the procedure to add code to my service to create dependencies that MSSQLSERVER has to be running before my service starts?
Any help is appreciated.
Lost in the vast sea of .NET
|
|
|
|
|
Insted of creating dependencies, can you just check the status of the MSSQLSERVER service and start it if it is not running?
|
|
|
|
|
I thought about that, but I don't want the service to just shut down if it can't find SQL. With dependencies doesn't the server sort of handle the order that it starts everything to make sure a service that depends on another service doesn't get started first?
Lost in the vast sea of .NET
|
|
|
|
|
I'd say you're right. I usually try to take the easy way out.
Check this out: How to: Code Service Dependencies[^]
It appears there is a ServicesDependedOn property on the ServiceInstaller class.
|
|
|
|
|
It worked perfectly! Thanks!
Lost in the vast sea of .NET
|
|
|
|
|
I've been writing an app (desktop) that has information that needs to be passed between forms. I'd like to use an object to move the information about the forms, but it didn't seem too feasible. I did some research online and most people say to use a 'global' module that holds the variables that are common amongst the forms, but there are trade-offs. However they (the articles I've read) won't specify the trade-offs. Is it a performance issue that is caused by doing this? Is there a way to move an object from form to form cleanly?
I'm just curious as to this community's thoughts on the subject. If this needs to move to another forum area, please feel free. I placed it here because I develop in VB.Net 2k5.
Thanks in advance.
|
|
|
|
|
|
Thank you! This was very helpful.
|
|
|
|
|
You're welcome.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
I want to draw a line on a picture box, when mouse key is pressed it will save the current position and when mouse key is released it will draw a line up till that point. but my code is not working, can any body help me out of this.
[code]
Public Class Form1
Dim x1, y1, x2, y2 As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
x1 = MousePosition.X
y1 = MousePosition.Y
End Sub
Private Sub PictureBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp
x2 = MousePosition.X
y2 = MousePosition.Y
End Sub
Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
e.Graphics.DrawLine(Pens.Black, x1, y1, x2, y2)
End Sub
End Class
[end code]
thanks in advance
Fareed
|
|
|
|