|
Hi Dave,
This might be some sort of version issue, because I tested it myself, first by putting radiobuttons directly onto the form, and after your reply, I tried it with a panel, and I get no checked radiobuttons whatsoever... I tested with VS.NET 2003, .net 1.1, on win XP.
Best Regards,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
I think you may be right. I did this in 2005 and got a checked RadioButton every time.
I'll make up the same exact project in 2003 and see what happens, then convert it to 2005 and see.
|
|
|
|
|
Confirmed it's a version issue.
Under 2003 and .NET 1.1, the RadioButtons do not pick a default selection. They ALL stay unselected with the default configuration.
Under 2005 and .NET 2.0, the first RadioButton gets selected automatically.
|
|
|
|
|
thanks john for replying,i go with u that what dave said is not true,but i guess u didnt understand my problem.
as u said ,radio buttons by default should be unselected,and that is not my case ,when loading my forms some of the radio buttons are checked eventhough i didnt yet make the selection,so i checked the 'checked' property and it is set to false,that what doesnt make sense. as for why not using checkboxes cuz i want to force the client to give 1 choice only.
so what can u advise me to do?
10x alot.
|
|
|
|
|
Why it is behaving like it is, I have no clue. You said it yourself however, the radiobutton's idea is to force the user to make a single choice. I understand from your message that you don't want to have a default choice though.
One possible solution to your dilemma could be to fake it: add an extra radiobutton to the groupbox or panel or whatever, make it the default selected one, and .Visible = False . As an additional advantage you can then also check this radiobutton's checkstate to see if the user remembered to make a choice.
Hope this helps,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi all,
I am trying to extract messages from outlook express on a server and file them in a folder. - contact, subject and text
Does anyone know if this is possible or can direct me to a place where I can get help on this.
Many thanks in advance
|
|
|
|
|
Outlook exposes a COM interface so you can manipulate it - not sure about VB.NET but VBA (yuck) allows this very simply http://www.outlookcode.com/.
I am sure VB.NET allows you to use COM objects so look that up and you will be off to a good start.
Dan
|
|
|
|
|
i want to make crystal report in my windows form project,
i want a report on a table in sqlexpress database
but in the crystal report standard wizard , when i choose new connection ,
i choose OLE DB SQL server
i enter the server's name as "servername\sqlexpress"
and use windows authentication,
i got the following error:
Failed in logon
source: microsoft OLE DB provider for SQL server
Description: Invalid authorization specification
while i enabled all the protocols (via, tcp/ip, pipes,...) in the sql server
|
|
|
|
|
mostafaelfeky wrote: while i enabled all the protocols (via, tcp/ip, pipes,...) in the sql server
Well, you have to enable TCP/IP and remote connections, but you also have to enable Integrated Security.
Other than that, we'd have to see the connection string you're using.
|
|
|
|
|
I'm reading a series of images from a MS SQL table and saving them to directory. As part of the process, I'm resizing the image and changing its resolution from 96 to 72 ppi. The resizing works without a hitch, but I cannot figure out how to reduce the resolution. All of the output files continue to be 96 ppi. Any help would be greatly appreciated.
Here's the code
<snip...>
Dim bytImage() As Byte
bytImage = .ItemArray(4)
bytImage = ChangeImageResolution(bytImage, 72)
bytImage = ResizeImage(bytImage, 150)
Dim fs As New FileStream(strFileName, FileMode.OpenOrCreate, FileAccess.Write)
fs.Write(bytImage, 0, UBound(bytImage))
fs.Close()
fs = Nothing
<snip...>
Private Function ChangeImageResolution(ByVal bytInput As Byte(), ByVal intOutputResolution As Int16) As Byte()
Dim strmInput As New System.IO.MemoryStream(bytInput)
Dim strmOutput As New System.IO.MemoryStream
Dim imgInput As System.Drawing.Image
Dim imgOutput As System.Drawing.Image
Dim bmapTemp As Bitmap
' Create a temporary bitmap and set to output resolution
imgInput = System.Drawing.Image.FromStream(strmInput)
bmapTemp = imgInput
bmapTemp.SetResolution(intOutputResolution, intOutputResolution)
imgOutput = New Bitmap(bmapTemp)
imgOutput.Save(strmOutput, System.Drawing.Imaging.ImageFormat.Jpeg)
' Return the output image in a byte array
ChangeImageResolution = strmOutput.ToArray
End Function
Private Function ResizeImage(ByVal bytInput As Byte(), ByVal intFinalMaxDim As Int16) As Byte()
Dim strmInput As New System.IO.MemoryStream(bytInput)
Dim strmOutput As New System.IO.MemoryStream
Dim imgInput As System.Drawing.Image
Dim imgOutput As System.Drawing.Image
Dim intMaxDim As Int16 = 0
Dim intResizePercentage As Double = 0
Dim sizResize As New Size
' Determine the resizing percentage based on current image dimensions
imgInput = System.Drawing.Image.FromStream(strmInput)
If imgInput.Height >= imgInput.Width Then
intMaxDim = imgInput.Height
Else
intMaxDim = imgInput.Width
End If
intResizePercentage = (intFinalMaxDim / intMaxDim)
With sizResize
.Width = CInt(imgInput.Width * intResizePercentage)
.Height = CInt(imgInput.Height * intResizePercentage)
End With
' Create a new resized version of the image
imgOutput = New Bitmap(imgInput, sizResize.Width, sizResize.Height)
imgOutput.Save(strmOutput, System.Drawing.Imaging.ImageFormat.Jpeg)
' Return the output image in a byte array
ResizeImage = strmOutput.ToArray
End Function
|
|
|
|
|
The dpi is just metadata in the image. It has no effect on the display, printing, or quality of the image. It's kind of like a footnote.
|
|
|
|
|
Dave,
Thanks for your response. Sorry about the ppi/dpi confusion – my graphics app uses "ppi" and Windows uses "dpi".
To further clarify my problem...these are staff ID pictures from our security card app. Once I've extracted the ID photo from the security app to disk, I need to reference the disk file in our HR app. The images are not printed from the HR app, but if they are not at a 72 dpi resolution, the HR app freezes. Somehow I've got to figure out how to change the resolution.
|
|
|
|
|
There's a picture in a program (not mine). How can I simulate a click on the picture? (I know the coordinates)
Thanks,
SMA
|
|
|
|
|
There is no "SendMouse" or "SendClick" so you have to use the Win32 API functions FindWindowEx to get the window that the image is in, get it's window handle, then use the API function SendMessage to send carefully crafted WM_LBUTTONDOWN and WM_LBUTTONUP messages to that window.
Warning: This is NOT something for beginners!! You have to have specific knowledge of how Windows works and how your application works. If you don't have sufficient research skills, you'll find this a very frustrating experience.
|
|
|
|
|
Hi,
I'm looking for a guide to create a wizard on VB 2003.
I did find many articles and guides how to create wizards in C++\C#\VB2005, but not a single one besides from microsoft's guide (which I didnt understand much of):
http://msdn2.microsoft.com/en-us/library/7k3w6w59(vs.71).aspx[^]
Must I mention that I'm new to VB, and if anyone could explain to me how to, and what to, that'd be greate. PLEASE PLEASE PLEASE.
|
|
|
|
|
The link you posted doesn't create a Wizard, but is a Wizard that helps you create an Add-In for Visual Studio.
Have you tried looking at the code in this article[^]?
|
|
|
|
|
I am working with Visual Studio 2005 w/ Service Pack 1 for Vista
I experienced a crash in Vista last night while "playing" my app. As it was the end of the day, I did not log back in and went home.
I came back in today, opened my solution and now am greeted by a friendly message from Visual Studio when I attempt to open the form [design] telling me that "The file cannot be opened with the selected editor. Please choose another editor. "
If I build the project, I get an error saying "String cannot have zero length" The file specified is "LC" (which is not the name of anything I have in my solution.). No line number is listed, nor column.
I am able to open the code for the form, the form designer, and a separate form in my solution.
I've Googled the error and so far found nothing that is of any help.
I am hoping that the good people of Code Project have seen this before and might know of how I can track down what is causing the problem or a fix.
Thanks in advanced!
-Steve
|
|
|
|
|
I don't use Vista, and haven't seen that problem under XP yet either.
The first thing I'd try would be to close the Solution, go into the Projects folder and delete the .SUO file (which is normally hiddden). Then try reopening the project.
After that, I would suspect that one of the files for that form has been corrupted somehow. I'd probably try salvaging the code for the form by opening its .vb file in Notepad and copying it to another file, then delete the form from the project, making sure the .vb, .resx, and .designer.vb files are removed, then recreate then form with all the controls using the same names you used before. You can copy and paste the code you salvaged back into the form's code.
|
|
|
|
|
Thanks for the suggestion Dave.
Deleting the SUO file did not fix it, but like a cautious VS user, I had a backup from a couple days ago I restored and updated with the notepad opened VB files. Still wish I could track down what went wrong for the time I don't have a backup or for other users.
|
|
|
|
|
How can I show the contents of a webpage in my program?
(F. e. if I'm making a web-browser)
The real $M@
|
|
|
|
|
I found this which might help...
|
|
|
|
|
|
|
This is the same link the other person gave. You might want to read the other posts before you reply.
|
|
|
|
|
Dave Kreskowiak wrote: This is the same link the other person gave. You might want to read the other posts before you reply.
You are absolutely right. My appologies for this.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|