|
Hi
Can anyone tell me
HOW CAN I SAVE A PICTURE FILE OR PICTUREBOX.IMAGE IN XML FILE IN VB.NET?
i must save my form and all it's component in XML format and then again create my form by using my xml file. how can i do this and save image in picturebox on my form?
Best Regards
M.Khayatan
MkhProgrammer
|
|
|
|
|
XML wasn't really designed to handle binary data like an image, but it is possible to do. Check out this article[^] by CodeZX to see how it's done. It's written in C#, but converts easily to VB.NET.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi!
I am new to .net.
I need urgent help with some coding.
What I have to do is to display the data, entered by a user, in a data grid on the same page, when the user clicks on the save button.
But I can not access any database for this purpose.
se I have created a datatable to load the datagrid. But my problem is that every time the save button is clicked, the previously entered data is erased. This means that my datagrid is effectively displaying only one row at any time.
I read somewhere that hidden fields can be used for this purpose. But i know nothing about them.
Can someone tell me how to go about this?
Any suggestions will be highly appreciated.
Thanx.
|
|
|
|
|
Your question would be better answered in the ASP.NET Forum.
I think about the only place your going to be able to store any data is in the Session object. But that's just my opinion from limited experience.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
my application is running, then suddenly it terminated by itself and exit from the program without any error message. The termination time is not consistent as well.
Please, someone please tell me what is the consequences that the application will terminated by itself?
Jeannie.....
|
|
|
|
|
oceangenie wrote:
someone please tell me what is the consequences that the application will terminated by itself?
It really depends on what the application is doing at the time.
I think you should be more focused on finding out why the application is terminating and fixing that instead.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
Can anyone help?
My timer stops automatically. Does anyone know why the application run but suddenly the timer stops?
Within my application, i have a timer which act like interval of running program, for example, 5 seconds. Then within 5 seconds, it will do processing inside. But from time to time, my timer will stop automatically within any action that caused. The time it stops is not consistence. Sometimes 5 mins after the application runs, sometimes 15 and sometimes longer.
Thank you.
Jeannie.....
|
|
|
|
|
There's got to be something else going on that is disabling the Timer. There are no known problems with the Timer classes.
Are you disabling the timer in your Tick event handler, then re-enabling it at the end of the handler? Does this handler have any Try/Catch blocks in it that might be bypassing the enable code?
A code snippet showing your setup of the timer and its Tick event handler might help.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I am trying to create a print button that will print a screenshot of the window im working in. Currrently, i have to hit Alt+PrintScreen, copy that into Paint and then print it through Microsoft photo editor. I would like to make this happen with just a print button. Can anyone help me with this matter?? thanks!
megadith
|
|
|
|
|
Could we get a little more info about what it is your wanting to print,
Is it the active VBform window, another program window your working in, or the Entire Screen shot?
If it's just a VBform checkout this,
Print a form's image in VB.NET
http://www.vb-helper.com/howto_net_print_form_image.html
if it's a screen shot checkout this,
ScreenShotDemo vb.net
http://www.developerfusion.com/forums/topic.aspx?id=21514
Hope that helps
|
|
|
|
|
That first link works great, with the exception of not printing title bars. oh well
thanks alot anonym-dude!
megadtih
|
|
|
|
|
'Here is one that will print the titlebar too..
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents btnPrintForm As System.Windows.Forms.Button
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
Me.btnPrintForm = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'btnPrintForm
'
Me.btnPrintForm.Location = New System.Drawing.Point(88, 216)
Me.btnPrintForm.Name = "btnPrintForm"
Me.btnPrintForm.Size = New System.Drawing.Size(136, 24)
Me.btnPrintForm.TabIndex = 0
Me.btnPrintForm.Text = "Button1"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Controls.Add(Me.btnPrintForm)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
' create a printing component
Private WithEvents pd As Printing.PrintDocument
' storage for form image
Dim formImage As Bitmap
' create API prototype
Private Declare Function BitBlt Lib "gdi32.dll" Alias _
"BitBlt" (ByVal hdcDest As IntPtr, _
ByVal nXDest As Integer, ByVal nYDest As _
Integer, ByVal nWidth As Integer, _
ByVal nHeight As Integer, ByVal _
hdcSrc As IntPtr, ByVal nXSrc As Integer, _
ByVal nYSrc As Integer, _
ByVal dwRop As System.Int32) As Long
' Callback from PrintDocument component to
' do the actual printing
Private Sub pd_PrintPage(ByVal sender As Object, _
ByVal e As System.Drawing.Printing.PrintPageEventArgs) _
Handles pd.PrintPage
e.Graphics.DrawImage(formImage, 100, 100)
End Sub
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
' create an instance of the PrintDocument component
pd = New Printing.PrintDocument
Me.StartPosition = FormStartPosition.CenterScreen
End Sub
Private Sub btnPrintForm_Click(ByVal sender As _
System.Object, ByVal e As System.EventArgs) _
Handles btnPrintForm.Click
' initiate the printdocument component
GetFormImage()
pd.Print()
End Sub
Private Sub GetFormImage()
Dim g As Graphics = Me.CreateGraphics()
Dim s As Size = Me.Size
formImage = New Bitmap(s.Width, s.Height, g)
Dim mg As Graphics = Graphics.FromImage(formImage)
Dim dc1 As IntPtr = g.GetHdc
Dim dc2 As IntPtr = mg.GetHdc
' added code to compute and capture the form
' title bar and borders
Dim widthDiff As Integer = _
(Me.Width - Me.ClientRectangle.Width)
Dim heightDiff As Integer = _
(Me.Height - Me.ClientRectangle.Height)
Dim borderSize As Integer = widthDiff \ 2
Dim heightTitleBar As Integer = heightDiff - borderSize
BitBlt(dc2, 0, 0, _
Me.ClientRectangle.Width + widthDiff, _
Me.ClientRectangle.Height + heightDiff, dc1, _
0 - borderSize, 0 - heightTitleBar, 13369376)
g.ReleaseHdc(dc1)
mg.ReleaseHdc(dc2)
End Sub
End Class
|
|
|
|
|
Any body can help me ?
I want to detect status of modem connect or disconect internet?
How can I do ?
|
|
|
|
|
I think this may be what your looking for,
HOWTO: Determine the Connection State of Your Local System and Initiate or End an Internet Connection by Using Microsoft Visual Basic .NET
http://support.microsoft.com/default.aspx?scid=kb;EN-US;821770
|
|
|
|
|
|
I have a simple question for everyone. I want to open a form from a button click, but I don't know the code for it. I know that in VB 6, all I had to do was, in the button_click sub, call form.open. That doesn't work in VB.Net though. Can someone help me?
|
|
|
|
|
private sub myButton_Click(byval sender as object, byval e as buttonclickeventargs) handles myButton.Click
dim secondaryForm as new frmSecondary
frmSecondary.Show()
'or
frmSecondary.ShowDialog()
end sub
where a form named frmSecondary is added to your project.
forgive typos, this is off the top of my head.
hope this helps.
-jim
|
|
|
|
|
Hi,
I need to parse html file written in plain text area in Visual basic 6.
Actually i've to extract only those images having src of either file:\\\ or local drive.
I need it urgent.
Regards,
Hina
|
|
|
|
|
hai,
In my vb.net project i want to allow user to select their item from the datagrid list. for that i need to checkbutton to each of the row in the datagrid so as the user can select one or multiple item from the list.
how can i do this one in vb.net?
thank in advance.
with regards,
balaganesh
|
|
|
|
|
I think your asking how to add a checkbox to a datagrid column, if that is the case then try here,
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatacolumnclassdatatypetopic.asp
Dim colBoolean As DataColumn = New DataColumn("BooleanCol")
colBoolean.DataType = System.Type.GetType("System.Boolean")
myTable.Columns.Add(colBoolean)
|
|
|
|
|
Hi I have the following script that will let me change DNS/WINS settings on remote machine. It will also report the current DNS/WINS settings. However It currently just displays the current DNS settings anyone know what why its not showning WINS settings?
' IMPORTANT !!!! Change these constants !!!!
Const STR_SERVERS = "TEST1 TEST2" ' Enter your servers here, separated by a space
Const STR_NEWDNS1 = "192.168.17.5"
Const STR_NEWDNS2 = "192.168.17.59"
Const STR_NEWWINS1= "192.168.13.20"
Const STR_NEWWINS2= "192.168.13.2"
' ///////////////////////////////////////////////////////////////////////////////////////////////
Do
cKeuze = MakeChoise( "Choose: Report or Change (R/C)?" )
Loop until cKeuze = "C" Or cKeuze = "R"
WScript.Echo
If( cKeuze = "C" ) Then
Change( STR_SERVERS )
Else
Report( STR_SERVERS )
End If
' ///////////////////////////////////////////////////////////////////////////////////////////////
' ///////////////////////////////////////////////////////////////////////////////////////////////
Sub Change( strParamServers )
arrServers = Split( strParamServers, " " )
For i = 0 To UBound( arrServers )
ShowDnsWins arrServers( i )
Do
cKeuze = MakeChoise( " Change DNS/WINS and reboot (y/n)?" )
Loop until cKeuze = "Y" Or cKeuze = "N"
If( cKeuze = "Y" ) Then
SetDnsWins arrServers( i )
RebootServer( arrServers( i ) )
End If
WScript.StdOut.Write( vbCrlf )
Next
End Sub
' ///////////////////////////////////////////////////////////////////////////////////////////////
Sub Report( strParamServers )
arrServers = Split( strParamServers, " " )
For i = 0 To UBound( arrServers )
ShowDnsWins arrServers( i )
Next
End Sub
' ///////////////////////////////////////////////////////////////////////////////////////////////
Sub ShowDnsWins( strServer )
strWinMgmt = "winmgmts:{impersonationLevel=impersonate}!//"& strServer &""
Set objNICs = GetObject( strWinMgmt ).InstancesOf( "Win32_NetworkAdapterConfiguration" )
WScript.StdOut.Write( strServer & ": " & vbCrlf )
For Each objNIC In objNICs
If objNIC.IPEnabled Then
WScript.StdOut.Write( " " & objNIC.Description & ": " & vbCrlf & " " )
n = 1
For Each strDns In objNIC.DNSServerSearchOrder
WScript.StdOut.Write "DNS" & n & ":" & strDns & " "
n = n + 1
Next
WScript.StdOut.Write( vbCrlf )
End If
Next
WScript.StdOut.Write( vbCrlf )
End Sub
' ///////////////////////////////////////////////////////////////////////////////////////////////
Sub SetDnsWins( strServer )
strWinMgmt = "winmgmts:{impersonationLevel=impersonate}!//"& strServer &""
Set objNICs = GetObject( strWinMgmt ).InstancesOf( "Win32_NetworkAdapterConfiguration" )
WScript.StdOut.Write( " Set DNS for NIC: " )
For Each objNIC In objNICs
If objNIC.IPEnabled Then
objNIC.SetWINSServer STR_NEWWINS1,STR_NEWWINS2
objNIC.SetDNSServerSearchOrder Array(STR_NEWDNS1,STR_NEWDNS2)
WScript.StdOut.Write objNIC.Description & " "
End If
Next
WScript.StdOut.Write( vbCrlf )
End Sub
' ///////////////////////////////////////////////////////////////////////////////////////////////
Sub RebootServer( strServer )
Set OpSysSet = GetObject("winmgmts:{(RemoteShutdown)}//" & strServer & "/root/cimv2").ExecQuery("Select *
from Win32_OperatingSystem where Primary=True")
WScript.StdOut.Write( " Reboot: " )
For Each OpSys In OpSysSet
WScript.StdOut.Write OpSys.Name
OpSys.Reboot()
Next
WScript.StdOut.Write( vbCrlf )
End Sub
' ///////////////////////////////////////////////////////////////////////////////////////////////
Function MakeChoise( strMesg )
WScript.StdOut.Write(strMesg)
WScript.StdIn.Read(0)
strChoise = WScript.StdIn.ReadLine()
MakeChoise = UCase( Left( strChoise, 1 ) )
End Function
|
|
|
|
|
You're probably going to kick yourself for this one -> You don't have any code to show the addresses!
Sub ShowDnsWins( strServer )
strWinMgmt = "winmgmts:{impersonationLevel=impersonate}!//"& strServer &""
Set objNICs = GetObject( strWinMgmt ).InstancesOf( "Win32_NetworkAdapterConfiguration" )
WScript.StdOut.Write( strServer & ": " & vbCrlf )
For Each objNIC In objNICs
If objNIC.IPEnabled Then
WScript.StdOut.Write( " " & objNIC.Description & ": " & vbCrlf & " " )
n = 1
For Each strDns In objNIC.DNSServerSearchOrder
WScript.StdOut.Write "DNS" & n & ":" & strDns & " "
n = n + 1
Next
WScript.StdOut.Write " WINS Primary Server : " & objNIC.WINSPrimaryServer & vbCrLf
WScript.StdOut.Write " WINS Secondary Server: " & objNIC.WINSSecondaryServer
WScript.StdOut.Write( vbCrlf )
End If
Next
WScript.StdOut.Write( vbCrlf )
End Sub
Now, There is a problem in Windows 2000 where Win32_NetworkAdapterConfiguration might not return valid WINS Server addresses if the user logged in is not a member of the Administrators group. This problem was fixed in Windows 2000 Service Pack 4.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
i just want to ask,does ms access have a pivot table wizard like in ms excel?coz im having problem with excel for there are only limited datas to store with.i just want to try if i can make it in database and run it in macro..is it possible?tnx..
|
|
|
|
|
Teach your users to analyze Access data with pivot tables and charts
http://techrepublic.com.com/5100-6270-1042409.html
|
|
|
|