|
The below example is for binding the double click event to a function, but you can use a similar method for all events.
sub CreateControls()<br />
Dim cnt as Control = new Button();<br />
' Add placement logic the usual way<br />
AddHandler cnt.DoubleClick addressof onDoubleClick<br />
End Sub<br />
<br />
private sub onDoubleClick(sender as object, e as EventArgs)<br />
' Execute double click code<br />
end sub<br />
For more on events see: MSDN help
Note you will have to bind the drag & drop functions if you choose to use this option.
|
|
|
|
|
Great...........
i got a solution for my problem
Thank you
Ramesh
|
|
|
|
|
Would anyone happen to know how to transfer any file through a networkstream, sort of like
'Load image wanted to be transferred<br />
Dim TP As Image = Image.FromFile(Path)<br />
'Save to stream to be transferred<br />
TP.Save(NetworkStream, Imaging.ImageFormat.Jpeg)<br />
TP.Dispose() 'Get rid of it
Except for any file (images, etc media(avi,qt,bmp,etc), plaintext files, executables, etc).
I've been looking at the other classes in system.io but nothing I've tried has worked so far.
|
|
|
|
|
You might be looking for something like this[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Sorry for being so long to reply. No, that isn't exactly what I am looking for, although I sort of found my own answer. I was able to send images etc by using a filestream and a binaryreader with readbytes, but that doesn't seem to work with any other file type. The output is slighty different from orignal file, if you could help me figure that out.
|
|
|
|
|
I have not many clues of what to do... I'm using VS 2003 (VB.net)
I'm trying to create controls on the fly, creating them is just fine. But if I afterwards want to change one of them, how to make that possible?
This code is just a simple example:
Private Sub Beginner()<br />
For i As Integer = 1 To 10<br />
Dim p As New Panel<br />
<br />
p.Name = "pnlThing" & i<br />
p.BackColor = System.Drawing.Color.Blue<br />
p.Size = New System.Drawing.Size(10, 10)<br />
p.Location = New System.Drawing.Point(10 * i, 10)<br />
<br />
Me.Controls.Add(p)<br />
Next i<br />
<br />
End Sub
Is there a way to make a reference so I can use pnlThing1.*method*?
Regards,
Hmmkk
-- modified at 11:38 Monday 26th December, 2005
|
|
|
|
|
You can iterate over the Me.Controls collection and do a comparison of the Name property with the name that you want to find. Then, just use that control.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Thank you!
Bah Nevermind:P I fixed all the rest now...
But Thanks for you answer!
-- modified at 13:29 Monday 26th December, 2005
|
|
|
|
|
Great to hear that! Happy coding!
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hello!
I put a password for my access database while I have developed my application and then I decided to update connection strings in design mode.
"I defined OLE JET DB" and test the connection with password but
it failed. It was asking for a workgroup file, which I created so but
it didn't work out again!
Do you have any idea how can I set a password protected connection string for
access database? I am using XP professional.
Bedri
bckurd@e-kolay.net
|
|
|
|
|
|
I want to transfer a XML file from client to server using Webservice . Please guide me infact i m new in Web Services
R A M
|
|
|
|
|
active x commponent cant create oject
can any one hlep me to solve this proplem
reda
|
|
|
|
|
how can i change Character Pitch of a dot printer?
|
|
|
|
|
See the manual on the printer for the exact character codes you have to send. You, of course, must be sending data to the printer directly and not using the Print objects in the .NET Framework.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I use raw data printing because i couldnt achive printing from dot printers with print object :S
|
|
|
|
|
Odd. Never had a problem with dot matrix printers myself...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
When i printing raw data from Laser jet i got this error.
How could i control which printers can print raw data , before to show printer list will be print documant
ERROR :
A call to PInvoke function 'RawPrinterHelper::OpenPrinter' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
|
|
|
|
|
The error means precisely what it said. You got the Declare statement wrong when you declared the parameters for the OpenPrinter function call.
OpenPrinter[^] on pinvoke.net.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hey all,
I want to add a column in winforms datagrid
That will show the combo box with multi columns.
Like
Id Name RollNo
1 A1 20
2 A2 30
This Combo Box has three columns
How we can create Multi Column Combo Box & embed them
On net I got the help about How to create a Multi Column Combo box (User Control)
But That User Control can't embed with the WinForms datagrid
Can u give any direction.
Hema Chaudhry
|
|
|
|
|
I want to change the width of Columns in my datagrid dynamically.
I have tried adding DataGridTableStyle and GridTextBoxColumn method (Adding styles dynamically) and i changed the size of all columns and then add them to TableStyle.
But it doesnt work ...
R A M
|
|
|
|
|
hi
im kinda newbie with VB
and while trying to change a font property for an object
i get an errorfor example
<br />
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click<br />
TextBox1.Font.Size = 12<br />
End Sub<br />
i'm getting the error that "Property 'size' is 'ReadOnly'
how can it be changed??
10x
-- modified at 21:02 Sunday 25th December, 2005
|
|
|
|
|
You have to make a new Font:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim oldFont As Font = TextBox1.Font
'Make a new font (12.0! is the size)
'Here i did it with the font family and style of the old one
'So only the size get's changed
Dim newFont As New Font(oldFont.Family, 12.0!, oldFont.Style)
'Give the textbox the new font
TextBox1.Font = newFont
'Dispose of the old font for memory
oldFont.Dispose()
End Sub
HTH!
Merry Christmas!
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
10x
i'll try this 1
Merry Christmas!
|
|
|
|
|
i want to open commondialog control with additional button called "Control Source" for activating the sourcesafe for getting files from source safe
still havent found a way
can someone help?
|
|
|
|