|
darkelv wrote: You declared an array of buttons, but the buttons are not instantiated. You need to instantiate them.
So in other words use the keyword "New" to instanciate it.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
to collocet my button in form to process them in queue
|
|
|
|
|
Merry Christmas to everyone!
Don't you know how I can get the image my form looks like?
I've tried DrawToBitmap method, but with that I didn't get the graphics, just the controls.
Please help if you can.
|
|
|
|
|
What is it you are trying to do? Put a picture on the form or as a background for the form?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Sorry I didn't write clearly, my problem is the following:
I've a form, and controls in it. I want to get the same image that the user sees on the screen. If I don't use graphics, I can use DrawToBitmap method. But what should I do if I use graphics too???
|
|
|
|
|
Hi,
if you do the graphics correctly, you will catch it. Here is a tiny paint instruction:
there are several steps to draw something so it becomes visible on the screen:
1.
decide upon what object you want to draw; it normally is a Control (e.g. a Panel) or a
Form itself. I prefer to add a Panel to a Form, then draw on the Panel.
2.
create some variables (Rectangle, struct, class, whatever) that hold the parameters of
your drawing. For a rectangle that could be top and left coordinate, and width+height,
or just a Rectangle. etc.
3.
create a Paint handler for that Panel, and do all your drawing in there, using the
Graphics class and your variables.
4.
when you want to change things, modify the variables and call Panel.Invalidate() or
one of its overloads (for selective invalidation).
5.
If you want to animate things, perform the move (step 4) inside the Tick handler
of a Windows.Forms.Timer
BTW: if you need to create some objects (Fonts, Pens, Brushes, ...) either keep them
alive in class members (hence create them only once); or create them inside the Paint
handler and don't forget to call Dispose() on them.
|
|
|
|
|
Hi,
I want to serialize a control.
I could not Serialize control datatype but I have created a Serializable() class that has a property that holds my control and I tried to Serialize object of that class but still not working.
Here is source.
<Serializable()> Private Class Slide_Master
Dim _Main_Panel As Object
Public Property Main_Panel() As Object
Get
Return _Main_Panel
End Get
Set(ByVal value As Object)
_Main_Panel = value
End Set
End Property
End Class
'Serializable class
'Code for writing in file
Dim sm As New Slide_Master
sm.Main_Panel = CType(pnlMain, Object)
Dim str As IO.Stream = IO.File.OpenWrite(Application.StartupPath + "\chl.dat")
Dim formatter As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
formatter.Serialize(str, sm)
str.Close()
Help me out
|
|
|
|
|
control class is doesnt have Serializable attribute. so you cant serialiaze i guess. is anyone know other method?
Manikandan.net
[Coding is life]
|
|
|
|
|
please, help me.
i want to add component control: mySQL VB API v2.0.0 in VB6.
But, mySQL VB API is not listed on component control.
How to make it listed?
I've register myVBQL.dll, and could not be loaded...
Please... help me...
|
|
|
|
|
I haven't used VB6 in so long... Try right-clicking the ToolBox, there should be something like "Add/Remove Item". Click it. A dialog should open up and you can find the MySql components, if they're exposed as such...
|
|
|
|
|
Hi
I am not using VB for some time now i do not remember exact menu option but may be the input will give u some idea..
go to project menu u have add component something like that.. There it lets u browse and select the dll to be added
Good luck
|
|
|
|
|
Hello every one
I am having a VB.net 2005 Express application.. I was having some issues with database connection and the way I was handling the errors
Now with some input I am using try and catch… Following is what I want to do
Execute Query
If any DB connection Error Display Retry Msgbox
If retry clicked then close the connection and open it again
If no error the execute the query If error for three times then close the application
Can any one plz help me to put these steps in nested Try and Catch
|
|
|
|
|
Try this concept..
<br />
Public Function YourFunction() as Boolean<br />
Try<br />
If ConnIsOpened then Close<br />
OpenConnection<br />
Execute SQL<br />
CloseConnection <br />
Catch ex as Exception <br />
If(Messagebox.Show("There is some errors, Do you wanna try again?",,,YesNoButton) = YesButton) then<br />
YourFunction()<br />
End If <br />
End Try<br />
End Function
|
|
|
|
|
how to add dynamically the usercontrol's to the page when ever the button click then only add the webusercontrol's to the page
|
|
|
|
|
Try LoadControl("/yourusercontrol.ascx")
|
|
|
|
|
Dynamicaly adding control's with out refreshing the page
|
|
|
|
|
You can only add the javascript or html control without refreshing the page.. If you want to add the server control, I think it will be too difficult.. You may want to check the ASP.NET Ajax...
|
|
|
|
|
use Java script to add the control dynamically, without refreshing the page.
example:
<br />
<div id="panel"></div><br />
<script language="javascript"><br />
var btn=document.createElement("input");<br />
btn.type="button";<br />
btn.value="Click me";<br />
btn.onclick=function()<br />
{<br />
alert("Btn Clicked");<br />
}<br />
panel.appendChild(btn);<br />
</script><br />
Manikandan.net
[Coding is life]
|
|
|
|
|
hi guys ,,
i am having some security issues on dot net 2.0,
i am running exe of my project from a shared location on my lan but i get some
security rellated errors ,"unveriafiable code.", but when in frame configuration i make
trusted level full of the intranet zone i get no error and it works fine, but it gives me more
probelms, do i have to make these setting on individual pc(too hard)?
simply is there any way that i could make my assemblies to run in partial trusted zones?
thansk in advance
|
|
|
|
|
ghumman63 wrote: do i have to make these setting on individual pc(too hard)?
Yes.
ghumman63 wrote: simply is there any way that i could make my assemblies to run in partial trusted zones?
Nope. You'd still have to go to each machine and tell it to trust that assembly.
If the machines are in a domain environment, then it's easy to do with a group policy.
Read this[^], then this[^], and then this[^].
Basically, you have to tell the machines to trust any assembly signed with a certain key.
|
|
|
|
|
thanks for your cincideration,
but any guide about doing that (group policy) any hepling stuff or web link,,
thanks in advance
hello
|
|
|
|
|
|
Can I use a delegate to write to a textbox on a 2nd form from a running subthread on the first form?
For instance, this code works fine to write from the thread to Me.Textbox1. However, if I change Me.Textbox1 to Form2.Textbox1 then the delegate does not write to that textbox on Form2 (no error, just blank textbox).
Thanks!
Public Sub ThreadProcSafe()
Me.SetText("This text was set safely.")
End Sub
Private Sub SetText(ByVal [text] As String)
If Me.TextBox1.InvokeRequired Then
Dim d As New SetTextCallback(AddressOf SetText)
Me.Invoke(d, New Object() {[text]})
Else
Me.TextBox1.Text = [text]
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.demoThread = New Thread(New ThreadStart(AddressOf Me.ThreadProcSafe))
Me.demoThread.Start()
'Form2.Show()
End Sub
|
|
|
|
|
I think you can. But I've always heard that crossing over threads is not the best, though.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
yes but before you can access the textbox properties, you must do an invoke to get the population of the textbox onto the main thread...
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
|
|
|
|