|
Then, how to reload the picturebox.image?
|
|
|
|
|
Reload the file, as explained in the link!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello everybody,
whenever I run any VB program (like Hello world, datepicker) which outputs message in a message box, the content is always blank, even a simple notification comes out blank, the problem is that the msgbox does appears, the string seems to have been written (the size of the msgbox changes depending on the lenght of the message) but it is not visible.
can anyone tell me why this is happening, and how to fix it
Thanks
Ignorance is darkness.
Knowledge is light.
|
|
|
|
|
hi,
please put in your code here.
thanx
|
|
|
|
|
Yes, I agree with Anonynous - please show us your code. In the meantime, you haven't set the text (font) colour and the background colours to be the same thus making the text effectively 'invisible'?
...Steve
|
|
|
|
|
This is the code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("your birthdate was " & DateTimePicker1.Text)
MsgBox("day of the year: " & _
DateTimePicker1.Value.DayOfYear.ToString())
MsgBox("Today is " & DateTimePicker1.Value.Now.ToString())
End Sub
I've checked the font color (Black) and background color (Transparent)
I've read that it might be something to do with McAfee and their buffer overflow protection. I'm trying to find a patch which McAfee has made availabel but I can't seem to find it right now, if you know the url, could you please let me know what it is?
Thanks
Ignorance is darkness.
Knowledge is light.
|
|
|
|
|
I Googled "mcafee blank msgbox" and see a whole heap of hits for this problem. McAfee Viruscan 8.0 Patch 10 fixes it. I don't have a URL for the patch as I get it automatically. Try www.mcafee.com.
...Steve
|
|
|
|
|
Check this:
Public Class Params
Private Shared iParam As Integer
Public Structure ParamFields
Public FieldArray() As String
Public Const Value1 As Integer = 1
Public Const Value2 As Integer = 2
End Structure
Public Function Value(ByVal sequenceID As Integer, ByVal routinID As Integer) As ParamFields
'This is where some action must be carried out before I read Value1 and Value2.
'Using a structure in this way is only way to accoumplish this I think?????
End Function
End Class
I use it like this :
------------------------------------
dim oParam as new Params
msgbox(oParam.Value(10,11).Value1)
------------------------------------
In this example Value1, Value2 is constants but they can change depening on what I pass to Value-function.
My question ... Can I retrieve Value1 by using:
-------------------------------------------------
dim oParam as new Params
msgbox(oParam.Value(10,11))
-------------------------------------------------
i.e use Value1 as default trough ToString or something else? any suggestions?
Regards // Maw
|
|
|
|
|
I don't think you can use a structure this way. It would be problematic especially if the struture's internal structure changed.
A better method would be to define Value1 and Value2 as Properties of the Params class. In this way the call to the Value() method would set these properties and you'd need to code Property Get methods for both Value1 and Value2.
Public Class Params<br />
<br />
Private Shared iParam As Integer<br />
<br />
Private m_nValue1 as Integer<br />
Private m_nValue2 as Integer<br />
<br />
Property Get Value1() as Integer<br />
Value1 = m_nValue1<br />
End Property<br />
<br />
Property Get Value2() as Integer<br />
Value2 = m_nValue2<br />
End Property<br />
<br />
Public Sub Value(ByVal sequenceID As Integer, ByVal routinID As Integer)<br />
' code to calculate m_nValue1 and m_nValue2. set to constants in this sample.<br />
m_nValue1 = 1<br />
m_nValue2 = 2<br />
End Sub<br />
<br />
End Class
You can then use the Params class like this:
Dim oParam as Params<br />
Set oParams = New Params<br />
<br />
oParams.Value(x,y)<br />
<br />
Msgbox(oParam.Value1)<br />
A bit more coding but has the advantage of being easier to read, test and understand.
...Steve
|
|
|
|
|
i have been coding my 8 led's thru parallel port using visual basic and now i must sent the notification to PDA user..but i don't know to code it and using what language.
example : first led on, then the signal sent to PDA user appear as a message to tell user first led is on. anyone can help me to solve that problems.
help me plsssssssssssssss.......
thank you...
sweet honey
|
|
|
|
|
Hi folks I have a stored procedure which selects the following:
sbu_id
profit_id
sub_id
act_id
acct_id
acct_name
policy_nbr
policy_eff_date
netPremium
Now I have these names in the header of the datagrid. I would like to change this. This is a winform
application.
Looking at the below sub routine I tried to the mapping for one field. Nothing came out. Can someone help me.
Private Sub btnApplyBoundEDB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnApplyBoundEDB.Click
'get connection string
Dim connstring As String = System.Configuration.ConfigurationSettings.AppSettings("FinSolMainDBConn")
Dim cnn As SqlClient.SqlConnection = New SqlClient.SqlConnection(connstring)
Dim cmd As New SqlClient.SqlCommand
Dim da As New SqlClient.SqlDataAdapter
Dim ds As New DataSet
Try
cmd.CommandText = "dbo.stp_NewRen_Override"
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = cnn
da.SelectCommand = cmd
'create parameters to pass to command
Dim prm As SqlClient.SqlParameter
prm = cmd.Parameters.Add("@sSbu", SqlDbType.NVarChar, 5)
prm = cmd.Parameters.Add("@dFirst", SqlDbType.DateTime, 8)
prm = cmd.Parameters.Add("@dLast", SqlDbType.DateTime, 8)
cmd.Parameters("@sSbu").Value = cboSBU.SelectedValue
cmd.Parameters("@dFirst").Value = C1PeriodFrom.Value
cmd.Parameters("@dLast").Value = C1PeriodTo.Value
da.Fill(ds)
Catch ex As Exception
MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OKOnly)
End Try
'Dim dt As New System.Data.DataTable("testdatatable")
'Dim dc As System.Data.DataColumn
' Dim dr As System.Data.DataRow
Dim textboxc1 As New DataGridTextBoxColumn
Dim DataGridTableStyle1 As New DataGridTableStyle
textboxc1.MappingName = "sbu_id"
textboxc1.HeaderText = "SBU"
textboxc1.Width = 80
' Add table style to grid
DataGridTableStyle1.MappingName = ds.Tables(0).ToString
-----------------------------------------------------------------------------------------------------------------------------
I have also went though and changed the following below in hopes that this will work also to no avail.
C1TrueDBGrid1.DataSource = ds.Tables(0)
' sbu_id
'dc = New DataColumn
'dc.DataType = System.Type.GetType("System.String")
'dc.ColumnName = "SBU"
'dt.Columns.Add(dc)
' profit_id
'dc = New DataColumn
'dc.DataType = System.Type.GetType("System.String")
'dc.ColumnName = "ProfitId"
'dt.Columns.Add(dc)
' sub_id
'dc = New DataColumn
'dc.DataType = System.Type.GetType("System.String")
'dc.ColumnName = "SUBId"
'dt.Columns.Add(dc)
Basically I am testing it with one field and nothing is working as of yet.
Any advice on the code above will be appreciated.
Thanks
|
|
|
|
|
In treeview, add a key and a name.
treeview1.nodes.add("key","name")
How to get the key?
Thanks!
|
|
|
|
|
hrmmz
As the old days ... This isn't correct but you'll get the idéa
dim myNode as TreeNode
set MyNode = treeview1.nodes(Name)
msgbox(myNode.Key)
maybe .....
msgbox(treeview1.nodes(Name).Key)
//Maw
|
|
|
|
|
I need to generate barcode, but i only want the numbers of barcode, whitout images.
Someone can help me.
Thanks.
|
|
|
|
|
Generate it from what source ? There are some articles on barcodes on this site.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I’m trying to drag & drop listview items between two instances of my app. The actual data that’s passed in DoDragDrop is an arraylist that’s been serialized to a memorystream. The contents of the arraylist are objects of a simple, serializable custom class that allows the recipient listview to reconstruct the dragged listitems. (the contents of the arraylist actually don’t matter…they can be simple integers and the issues in this post remain the same)
When I’m dragging & dropping within an instance of my app, e.Data from the DragDrop event is a DataObject and I can extract my memorystream, deserialize it, and I’m good. However, when I drag & drop to another instance of my application, e.Data is a System.__ComObject. Attempting to extract my data with the normal e.Data.GetData method results in a memorystream that’s, according to the Locals window, a System.Runtime.Remoting.Proxies.__TransparentProxy, which is beyond the scope of my VB knowledge. Regardless, it doesn’t deserialize, and now I’m stuck.
So could someone kindly explain what I need to do to the __ComObject to get my memorystream out? Here’s my code:
If e.Data.GetDataPresent("System.IO.MemoryStream") Then
Dim Formatter As New BinaryFormatter
Dim Stream As New System.IO.MemoryStream
Dim DropList As New ArrayList
Stream = e.Data.GetData("System.IO.MemoryStream")
Stream.Position = 0
DropList = Formatter.Deserialize(Stream)
Any help would be appreciated.
Neil
|
|
|
|
|
I am trying to create a program for my company which will create new folders for incoming employees. This folder needs to be created and the sharing permissions need to be set programmatically (VB.NET). I know how to create the folder, but setting the permissions is posing a problem. If anyone has any advice on the matter, I would greatly appreciate it.
|
|
|
|
|
The .NET Framework BCL (1.0 and 1.1) don't have any support for doing this. The .NET Framework 2.0 does.
In the mean time, you can use a class library found here[^] on GotDotNet to do this.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Somewhere in the past couple years I heard that VB.Net has something built in that will copy a SQL Server table(including schema) to a file. Now that I want to use it, of course I can't find anything on it. Anyone familiar with this?
|
|
|
|
|
Could you be referring to the DataSet class' ability to save to an XML file?
DataSet.WriteXML()[^] method docs.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
I just want to have an idea on how can I read the data from a time-tracking device (everytime an employee swipes his ID card) and be automatically copied into a backend Access database of my VB.NET program. What should be the coding for that? I really can't imagine how and what code should I write in my VB.NET program to get data from the device shoot into my database. And not only that, the device is not directly connected to HR's PC but connected through the LAN network.Can anyone help me regarding this matter?...Please...Thanks...
|
|
|
|
|
The easy part is putting the data into the database.
The hard part is getting a notification from the "device" and communicating with it. Without knowing anything more about the "device", it's impossible to tell you anything useful, other than consult with the manuals and manufacturer of the "device" to find out what you have to do.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I'm developing an WinForms application in VB.NET where the user can specify custom formats for numeric data entry fields.
When I display data in lists, labels, editboxes, etc. I simply use Double.Format(strCustomFormat) to format the double values in the desired format - no problem here.
But I'm having a problem converting the strings back to a double since I basicly don't know if the user is using a 1.234.567,09 or 1,234,567.09 format.
So basicly I need a Double.Parse method where I can specify the format (similar to the ParseExact that DateTime has)... but this is not available as standard for Doubles
Is there any other way I can do this ?
Thanks you in advance.
/Bean
|
|
|
|
|
Hi,
Use string replace(",","") method for removing , commas
|
|
|
|