|
Thanks, I really appreciate it.
Posted by The ANZAC
|
|
|
|
|
Glad I could help
I'm not dumb I just have a huge command of thouroughly usless infromation.
|
|
|
|
|
I have a transparent form (border style 0) that has no maximize button. Still when I double-click the window, it maximizes. Is there a way to prevent this happen when doubleclicking? And if there is a built-in keyboard combination in Windows XP to maximize windows, I would like to prevent that too.
Thanks!
|
|
|
|
|
Use the MinimumSize and MaximumSize properties (set them to the same value).
|
|
|
|
|
Thanks, but I have tried that. Window still gets maximized.
I have used this code to make my form movable:
Protected Overrides Sub WndProc(ByRef m As _
System.Windows.Forms.Message)
Const WmNcHitTest As Integer = &H84
Const HtCaption As Integer = 2
If m.Msg = WmNcHitTest Then
m.Result = New IntPtr(HtCaption)
Else
MyBase.WndProc(m)
End If
End Sub
Maybe there is the problem?
|
|
|
|
|
Doesn't anyone know how to solve my problem?
|
|
|
|
|
We're sorry, you caught us all on a Holiday Weekend, in the States anyway. It's very rude to demand an answer in a forum environment.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I'm wondering what you put in to make it do that. I put a little test project together, turned the FormBorderStyle to None (0) and can't duplicate the behavior you're talking about.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
What's that piece of code supposed to do?
|
|
|
|
|
The border style is set to zero and the form is transparent. The code snippet I posted makes the form movable. When I double click the form it will maximized. This is strange.
|
|
|
|
|
I am working on Linux right now, so I cannot check this, but maybe you could try to set an appropriate size of your form in OnResized or OnMaximized (I guess that there are such events) event handlers.
|
|
|
|
|
Why not use plain old .NET code to make the form movable? You won't have this problem then.
|
|
|
|
|
Hello, I am new to writing console applications in VB.NET. I need some advice on how to get the little bit of text after the .exe /.
For example if I open a command window and type
program.exe /help or something like that
Or if you type
program.exe /? It will show help....
Thanks in advanced.
Aaron
|
|
|
|
|
Hi,
use command line arguments!
command line arguments means the arguments you pass to your applications main() method.
hope this works.
Nitin...
|
|
|
|
|
Hmmmm, OK I know exactly what yo mean...
But how?
Thanks again
Aaron
|
|
|
|
|
Your Sub Main can be changed to this:
Function Main(ByVal CmdArgs() As String) As Integer
Dim ArgNum As Integer ' Index of individual command-line argument.
If CmdArgs.Length > 0 Then ' See if there are any arguments.
For ArgNum = 0 To UBound(CmdArgs)
' Examine CmdArgs(ArgNum) for settings you need to handle.
Next ArgNum
End If
Return 0 ' Zero usually means successful completion.
End Function
You can find more information here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks, I think I will get i working from here...
Thanks again
Aaron
|
|
|
|
|
Hi!
I'm using XMLTextReader and GetAttribute in order to parse a XML file. The problem is that the the file isn't 100% valid XML. File begins with many lines of "#####". My application works fine if I remove these lines from the file. But if I don't want to modify it, I keep getting error "Exception System.Xml.XmlException was thrown in debuggee: Data at the root level is invalid. Line 1, position 1."
Is there a way to write a code that doesn't mind these non-valid expression and manages to parse the attribute correctly?
With best regards,
RI
|
|
|
|
|
Hi,
Does anyone know how to do a search for files like in windows using vb.net.
thanks
|
|
|
|
|
Hello, I noticed your comment, and realised i had a similar need not so long ago, so i took it upon myself to create a program, which searches a chosen directory for a chosen file.
This program is basic and still glitchy, but should provide you with information you need on file searching. What is your email, so that i can email it to you.
Posted by The ANZAC
|
|
|
|
|
I'm trying to save the image to sql database, there is error "object must implement Iconvertible" when I run it. Here is my code:
(image is the location + the name of the image)
Try
Dim strFn As String = image
Dim fiImage As FileInfo = New FileInfo(strFn)
Me.m_lImageFileLength = fiImage.Length
Dim fs As FileStream = New FileStream(strFn, FileMode.Open, FileAccess.Read, FileShare.Read)
m_barrImg = New Byte(Convert.ToInt32(Me.m_lImageFileLength)) {}
Dim iBytesRead As Integer = fs.Read(m_barrImg, 0, Convert.ToInt32(Me.m_lImageFileLength))
fs.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Try
Me.SqlConnection1.Open()
If SqlCommand1.Parameters.Count = 0 Then
Me.SqlCommand1.CommandText = "UPDATE HRRecordIndexData SET pdf_location = @Picture WHERE entity_id = @ID"
Me.SqlCommand1.Parameters.Add("@Picture", System.Data.SqlDbType.Image)
Me.SqlCommand1.Parameters.Add("@ID", System.Data.SqlDbType.Int, 4)
End If
Me.SqlCommand1.Parameters("@Picture").Value = Me.m_barrImg
Me.SqlCommand1.Parameters("@ID").Value = Entity
Me.SqlCommand1.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
Me.SqlConnection1.Close()
End Try
If there is everyone knows what it needs to fix at my code, I would very appreciate it .. thanks!
Lisa
|
|
|
|
|
Lisa,
are you sure the field "pdf_location" has type "image"?
Regards
Ray
|
|
|
|
|
Hello, Ray,
I created another field called thumbnail and the datatype is image, and I run it again, the result is the same, it still gave me the same error.
thanks!
Lisa
|
|
|
|
|
Hi,
I have similar code and it works.
The difference is only in parameter type definition :
System.Data.SqlDbType.VarBinary , not image.
Here is my code:
fv =me.openFileDialog1.FileName
Dim fs As New FileStream(fv, FileMode.OpenOrCreate, FileAccess.Read)
Dim MyData(fs.Length) As Byte
fs.Read(MyData, 0, CInt(fs.Length))
fs.Close()
kom.Connection=conn
kom.CommandText="INSERT INTO PDF (DATA,F_NAME) VALUES (@duom,@failas)"
dim param1 as New SqlParameter("@duom", System.Data.SqlDbType.VarBinary)
param1.Value=MyData
kom.Parameters.Add(param1)
dim param2 as New SqlParameter("@failas", System.Data.SqlDbType.VarChar )
param2.Value=fv
kom.Parameters.Add(param2)
conn.Open
dim res as Integer=kom.ExecuteNonQuery()
|
|
|
|
|
{vb .net 2003}
I'm working on creating a few side panels for my application that will slide in and slide out as needed. I have one docked on the left side, so it will resize with the window and still look the way I want it to. To "slide" it, I'm using a timer that decreases the width of it, making it look like its sliding out. I want to move all the controls in it (labels and picture boxes) to follow the sliding motion but I can't change the width without screwing up how the text looks, so I decrease the left value of the label as I decrease the width of the panel.
My question is this:
Is there a way to adjust the left property of all control in a panel at the same time without having to hardcode each individual label? I thought about doing a control array but then I would need seperate arrays for each type of element. Any idea?
Thanks for your time,
BAM
|
|
|
|