|
Well, this question is asked a lot, just generally by people smart enough to post in the right forum.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi , I’m doing a little experiment.
I created procedures that can create new forms at run time.
------------------------------------------
Private Sub createForms()
Dim i As Integer
For i = 1 To 10
newform = New Form
newform.Name = "Form_" + i.ToString
newform.Show()
Next
End Sub
------------------------------------------
Now I want to move those forms on the screen, close them one by one, change size etc.
I cant find the way to acces the forms that I just created. I tried using newform.Name property but it dosent work.
Any suggestions???
Thanks
|
|
|
|
|
I am using Visual Studio 2008
I thought it might help if I mention this info.
Thanks
|
|
|
|
|
The newform variable can't be accessed outside of the FOR loop. I recommend making the form a global variable.
How many bytes of text have I typed in my lifetime??? Man, I wish I kept track...
|
|
|
|
|
But, he's creating 10 of them, not just one.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
As newform is created over an over, you are basically throwing away your reference to the new forms. The Application.Forms collection is one way to find them, but you can also build your own list and keep references that are strongly typed in that.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanks Christian for reply.
Could you please give me a sample of how to use Application.Forms collection for my purpose?
Thank you.
|
|
|
|
|
Thank you for the inputs.
If I would do the newform global, how then i can access and change individual forms properties?
Does some one can give me a workable solution
Thanks again.
|
|
|
|
|
I'm rewriting a VB6 application (DLL) using VB.net 2005. In my VB6 app I used "App.hInstance" to acquire the applications Instance handle. In my VB.net 2005 module I’m trying to use "Public Function GetHINSTANCE (m As Module) As IntPtr". But ‘Module’ keeps flagging as an error “keyword doe not name a type.” What am I missing?
Any suggestion?
Curt
|
|
|
|
|
I believe it's called Handle in .NET. At least, I think it's called that in C#.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
Hello,
I would like to show the properties of an objet that contains another object .
Here is a simplified example :
'Imports
<DefaultPropertyAttribute("Gestion parametres")> _
<Serializable()> _
<XmlRootAttribute(Namespace:="", ElementName:="PARAM", IsNullable:=False)> _
Public Class Cls_Param
Public _MyclsTest As new clsTest
Public Property MyclsTest() As clsTest
Get
Return _MyclsTest
End Get
Set(ByVal value As clsTest)
_MyclsTest = value
End Set
End Property
<Serializable()> _
Public Class clsTest
Private _AppName As String
<CategoryAttribute("Application"), _
Browsable(True), _
[ReadOnly](False), _
BindableAttribute(False), _
DesignOnly(False), _
DescriptionAttribute("Le nom de l'application"), _
XmlAttribute(AttributeName:="AppName")> _
Public Property AppName() As String
Get
Return _AppName
End Get
Set(ByVal value As String)
_AppName = value
End Set
End Property
End class
Public Sub New()
_MyclsTest = New clsTest
End Sub
End Class
In my form :
Public G_Param As New Cls_Param
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.PropertyGrid1.SelectedObject = G_Param
End Sub
if i choose :
Me.PropertyGrid1.SelectedObject = G_Param.cls_test , this works fine and i can see the object properties.
In the other hand, i want to give the object :
Me.PropertyGrid1.SelectedObject = G_Param , but this doesn't work.
How can i do this ?
Thanks.
|
|
|
|
|
You may want to look into the ExpandableObjectConvertor class. Add it as an attribute to your property like so: <TypeConvertor(GetType(ExpandableObjectConvertor))>
|
|
|
|
|
I have tried but it doesn't resolved the problem
|
|
|
|
|
how can i delete database records using code?
my code is
me.validate()
me.GuestBindingSource.remove()
but this code is wrong ,what would the right way?
|
|
|
|
|
Guessing doesn't really work, does it. I'd try google, or perhaps even buy a book.
You delete records with SQL.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
how to clear datagridview in vb.net
|
|
|
|
|
Is it bound or not? You want to delete the bound items or just make the DataGridView not viewing them anymore?
Start by reading this[^].
Eslam Afifi
|
|
|
|
|
Depends on what your trying to do. If your just trying to hide the grid itself, you could just set the visible attribute to false.
Example:
gridview1.Visible = False
This would just hide the grid from the user. If you were talking about resting it to a default state you would need to write some logic for the gridview and just update the databinding based on conditions set for the gridview.
Hope this helps.
Matthew Vass
QA Analyst
mvass@hostmysite.com
http://www.hostmysite.com?utm_source=bb[^]
|
|
|
|
|
Hay
I'm developing application with 100 users. How to deploy new version of EXE file in the morning if someone did not close application when he left the office yesterday??
I know that web application is a solution, but because of limitation on the web we really would like to develope "ordinary" windows (exe) application.
I'll be grateful for any advice
|
|
|
|
|
You could restart all computers in the LAN, effectively closing every open application.
What are you going to do about the computers that are turned off in the morning? I tend to shut down my computer before I go home
I are troll
|
|
|
|
|
Restarting all computer is not acceptible, because from 500 PC, only about 100 is using my application. There should be a way to enforce replacing exe file or enforce app exit on demand...
|
|
|
|
|
You can create a small application to loop through all the running processes, and if one of the processes running on the target-computer has the same name as your application - terminate it
500 computers that may be left running at night. I wonder how much energy (and money) that would cost?
I are troll
|
|
|
|
|
Couldn't you create a timer that would implement some type of "inactive" logic and close the application. The other way to think about this is maybe to implement a version number that could be checked and inform the user that a new version is available. I kind of like the timer approach, you could sell it as a security feature, An application should not be left open for the cleaning people to sniff around. Not that I have anything against cleaning people ... jeez you have to be politically correct even when you post.
|
|
|
|
|
David Mujica wrote: An application should not be left open for the cleaning people to sniff around.
Cool idea, easy to implement, and good argumentation. I'm gonna use your idea too, thanks
I are troll
|
|
|
|