|
Hi all,
I have 2 forms in my application say form1.cs, form2.cs
in form1.cs form load event iam writing the following code
form2 obj;
for(int i=0;i<n;i++)>
{
obj = new form2();
obj.show();
}
each instance of form2 does some operation and closed automatically.this code working fine.
now what my problem is
in some control (say textbox or label) on form1, i want to show how many instances of form2 are running. this value should modify when form2 instantiated/closed.
how can i proceed.
thanks in advance.
this is sumanth, completed m.c.a from india.
|
|
|
|
|
what u need is the no of instances right ....to do this take a static variable in the form1 say static int count; now in the form2.load event increament the variable as form1.count++;
after the obj.show; line assign the label value as form1.count; hope it works
if this thing also dint work then take a thread or timer to which executes a function and in that function assign the value to the label or textbox
regards
sindhu tiwari
its me sid
|
|
|
|
|
Application.OpenForms.Count
Application.OpenForms["Form1"]
I think this should help you out.
|
|
|
|
|
Hi,
if you want to know how many instances of a specific class exist, you should add some
code to that class, including: a static int counter, a property to get its value,
and one or two events to increment and decrement the counter. For form visibility,
the event would be Form.VisibleChanged
|
|
|
|
|
Hello everybody,
Can anyone tell me please what can I do to achieve Accordion's behavior in Windows form as most as possible
thanking you in advance
Rachamim
|
|
|
|
|
What do you mean by "Accordian's behavior"??
|
|
|
|
|
hello all, i need to make a package of a program that uses the MSDE as its database server, but i do not know how to pack the database into the package and attach it to the MSDE. also, how to pack the MSDE itself in the package
thanks
|
|
|
|
|
|
Hi all
I Wount to add Footer to DataGridView In C#.Net Windows Application
But In Windows Application The DataDridView Dont Have Footer To Add it
I wount to How i can add footer to DataGridView or A new Free Grid Control Have Footer
Thanks For Any Body Help Me
Thaer
|
|
|
|
|
Hi, I've written a total ownerdraw ListView, but I'm not able to "hot track" the mouse on headers ... There are events for painting the headers, mouse click, ...; but I've not found anything usable for mouse tracking ...
any ideas?
Thanks in advance /// Angel
|
|
|
|
|
Hey,
I need to browse a multiselection ListBox, especially getting the Values of selected items.
I filled it like this :
lbox.DataSource = 'some datatable';
lbox.DisplayMember = "Col1";
lbox.ValueMember = "Col2";
The SelectionMode chose is : MultiSimple
I need something like this
foreach (item in the selected items)
{
Display its value.. etc
}
Thank you.
|
|
|
|
|
a ListBox has a lot of useful properties, some related to the current selection;
I would not be surprised if the documentation would show some with names starting with
Selected. Would you care to read up on them?
|
|
|
|
|
Hey,
Of course I've done many research before asking here..
The problem i have is not with getting the collection of selectediems (lbox.SelectedItems and lbox.SelectedIndices..etc) but when trying to retrieve the Value associated to a selecteditem..
Thanks.. for not helping..
|
|
|
|
|
if the ListBox.DataSource is a DataTable, isn't each item in the ListBox a DataRow?
|
|
|
|
|
|
Hy there,I hava a problem..I created a control that has a public Brush property that the developer chooses from the property window. But If i change it..it doesn't get serialized to InitializeComponent() so at runtime it still has the default value
I created a UIEditor for this property and a BrushConverter : TypeConverter to let the design-time know how to convert from a InstanceDescriptor to a Brush.
Why doesn't this work? I debugged the design-time and when I change the property..the breakpoint in the method ConvertTo from the type converter doesn't hit
Thank you in advance.
|
|
|
|
|
Can't anyone help me with this problem? How can I make a control that has a Brush property that gets serialized to InitializeComponent()??
I mean I know that Brush is an abstract class..but Image is abstract to and that doesn't stop a Form to serialize it's BackgroundImage..for example. Damn
|
|
|
|
|
ctoma2005 wrote: Can't anyone help me with this problem?
It would probably help if you post the code in question.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
I have a complete database software program in vb.net working perfectly but i have a problem. During installation i want the user to be prompted to insert a username and password as a connection string to their database, i think it is also called a dynamic installation, But i can not implement that i was also told i can call the sql interface login in my project to appear once during installation but i have no idea how to implement that. I will be very greatful if anyone could assist me with help.
Thanks in advance
Ivan
|
|
|
|
|
It's far easier to have the app prompt the user if it's run and the data is not there, than try to make an installer do it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
|
You posted in another forum here. Do not do that. It is cross posting and considered very rude.
mwanyu wrote: playground
The playground is in the Soapbox :->
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
mwanyu wrote: I think its going to be my playground.
Not this forum it is Soapbox.
In BTW,why are you cross posting it? this is not a good practice.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
If i try to display child form then child form disappears, only MDi remains on the screen what might be the reason?
|
|
|
|