|
I want to fill the second combo box based from the information of the first combo box.
The first combo box take data from database table , I want the second combo box to be fill from the information or the list view to be filled.
The first question is right .
Thanks,
|
|
|
|
|
So what have you tried so far. Where are you having a problem, or is it that you want someone to write the code for you. Try researching databinding, linked combo boxes and anything else that comes to mind.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Compiled project don't works on another computer where I don't have Visual Studio installed but on the computer with installed Visual Studio I have no problem. I getting error message "System.NullReferenceException: Object reference not set to an instance of an object. "
I am using a WMI for getting HDD serial number.
This is code for my project:
Imports System
Imports System.Management
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Text = GetHddSerial()
End Sub
Public Function GetHddSerial() As String
Dim query As New SelectQuery("Win32_PhysicalMedia")
Dim search As New ManagementObjectSearcher(query)
Dim info As ManagementObject
Dim strSerial As String = ""
Dim i As Integer
For Each info In search.Get
strSerial &= info("SerialNumber").ToString
i += 1
If i = 1 Then Exit For
Next
Return Trim(strSerial)
End Function
End Class
|
|
|
|
|
Your code may or may not produce a valid serial number depending on a number of things.
1. Not all disk vendors do what is necessary for WMI to know your disk's serial number, i.e.
info("SerialNumber") may be Nothing, causing the NullReferenceException you now are having
(did you bother looking at the line numbers, or single-stepping your code, to see what exactly bombs?)
2. newer Windows versions will refuse to provide the information to non-admin users.
BTW: your use of variable i does not make much sense.
|
|
|
|
|
i'm doing a project 'keylogger' in vb 2005.What i'm currently doing is taking screenshots of the windows opened at a specific interval and is stored at a path.
These are to be later shown to the administrator.
I WANT TO DISPLAY IT AS SEEN WHEN WE OPEN A PICTURES FOLDER(that is i need to show the images captured as a list with the image as a thumbnail(medium in size) with its name as text below and once clicked the image should be opened in full screen).
Can anybody please help me on this...
|
|
|
|
|
Hi,
I'm trying to convert a DICOM image stored in an SQL database into a IO.stream to input into a DICOM viewer. Loading the image into the image buffer is not a problem but then converting it into a stream keeps giving me a "Object not set to an instance...." error.
The code snippet is as follows:
Dim myreader As DataRowView = Me.Tbl_XrayFilesBindingSource.Item(0)
Dim myImageBuffer() As Byte
myImageBuffer = myreader.Item(2)
Dim fileContent As Stream = Nothing
fileContent.Write(myImageBuffer, 0, Convert.ToInt32(myImageBuffer.Length))
Dim loadedPage As ImGearPage = ImGearFileFormats.LoadPage(fileContent, 0)
Everything is fine as far as the fileContent.Write statement.
Am I looking at this from the wrong angle or is it possible? Any ideas or alternatives please?
Thanks,
Alex
|
|
|
|
|
Solo1 wrote:
Dim fileContent As Stream = Nothing
fileContent.Write(myImageBuffer, 0, Convert.ToInt32(myImageBuffer.Length))
That's your problem. You set a Stream to Nothing, then write it. Remove the fileContent.Write line, and then set fileContent to a New MemoryStream, passing myImageBuffer as an argument
|
|
|
|
|
Thanks very much. Works perfectly!
|
|
|
|
|
I m doing small program.
1. Upload a random values to chart and build a plot
2. copy the chart using "MSChart1.EditCopy()"
3. Paste to PictureBox
Now I m facing problem. I m trying to paste the content into pictureBox. It is showing Fatal Error. can anyone help me from this problem.
My Aim is saving the plot into file(JPEG format).
Same method i m using for webcam but it is working properly.
Thanks in advance.
|
|
|
|
|
Hi,
I have created a form in excel where user can send the entire data into access database, but data will keep change every week. Now i want the audit trail report when data changed in database i can keep information about old value and new value abt the column with user & date/time. Currently i have created one form in access where user can change the value in form then audit report is genrating but my problem is that there is not manual entry in form. data will come in excel sheet & i have to upload it on access and also keep audit tral report. pls suggest me.
|
|
|
|
|
Hi,
I have posted this message few days back but still noone reply for this. Can anyone help me.
|
|
|
|
|
Hi,
I wrote an ActiveX control(dll) and purchased Certificate from Versign ..Now May i know how can i make my ActiveX as signed control and how can i use it in my html page...
|
|
|
|
|
Step by step explanation on signing is found here[^]. Embedding in a webpage is described in a CodeProject article, found here[^].
Enjoy
I are troll
|
|
|
|
|
Thanks for ur reply.....
But i need in VC++...pls try to help....
|
|
|
|
|
p_1960 wrote: But i need in VC++...
So your asking in the Visual Basic forum?? Try the Visual C++ forum instead.
|
|
|
|
|
I am positive that your VC++ programmer will understand the steps that need to be taken. VB.NET is fairly easy to read for a C++ programmer.
You can always come back here if you get stuck
I are troll
|
|
|
|
|
I have the following code to populate a checkedlistbox
'Sets up dataset
Dim ds2 As New DataSet
ds2 = Populate_Employees()
'Sets the checkedlistbox to the dataset and sets the displaymember and valuemember
clb_employee.DataSource = ds2.Tables("Employees")
clb_employee.DisplayMember = "Username"
clb_employee.ValueMember = "Employee_ID"
Now all i want to do is iterrate throught the checkedlist box and return the value of those that are checked.
Can anyone shed some light upon this for me?
|
|
|
|
|
Hi Mc--Gann,
The code bellow should help:
'loop through check box list
For i=0 To clb_employee.Items.Count - 1
If clb_employee.Items(i).Selected Then
'Do something with the selected value
strValue = clb_employee.Items(i).Value.ToString
End If
Next
I hope this helps.
|
|
|
|
|
thanks man i'll give it a try let you know how i get on
|
|
|
|
|
Getting this error:
Public member 'selected' on type 'DataRowView' not found.
*Remember this is a windows application i know this would have worked in asp
Thanks
|
|
|
|
|
Sorry, my mistake, I didn't realise it was a windows application. How about trying this:
Dim obj As Object
For Each obj In clb_employee.CheckedItems
strValue = obj.ToString
Next obj
Hopefully this will work better for you.
|
|
|
|
|
Hello all,
I would like to make the Tab movement can also pressing the "Enter" Key. I have google and found the code which possible to used. But I found its not running fine with me. When I press "Enter" key,it runs fine for the tab movement.
But if I put something into my textbox,it only allowed me to put 1 character and it will move next. Anyone can help me solve this? Because the Textbox 2 can able to put in any kind of numbers. But after add in the code that allowed "Enter" key move the Tabindex,it will move to the next tab index after I lick 1 character.
Please help me to check is that I use this code wrongly?
Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
If Keys.Enter Then
SendKeys.Send("{TAB}")
Exit Sub
End If
Select Case e.KeyChar
Case "0" To "9"
Case Microsoft.VisualBasic.ChrW(8) 'backspace
'Case Microsoft.VisualBasic.ChrW(46) 'dot (.)
' If InStr(TextBox2.Text, ".") > 0 Then
' e.Handled = True
' End If
Case Else
e.Handled = True
End Select
End Sub
Thanks you all so much for reading. Anyone can give me some suggestion how should I do to make the "Enter" key press work as tab?
Regards
Drex
|
|
|
|
|
Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
IF asc(e.KeyChar) = 13 THEN
write your code into this u will get write output
End If
End Sub
modified on Monday, April 20, 2009 6:33 AM
|
|
|
|
|
Thank you so much Mr. S.M.Kanerkar. Your solution works well.
Regards
Drex
|
|
|
|
|
good morning everyone,
i am getting an problem when i m trying to load images to crystal report. i have an report which has 56 images and i am trying to load all images at a time.in this situation some images are displayed properly but some are displayes as blank picture box. please tell me is this memory problem or crystal report and how to resolve it.
Error Message :-
The control is busy downloading data
thanks in advance.
modified on Monday, April 20, 2009 9:31 AM
|
|
|
|