|
|
hii 4 all
How can i iterate over all the forms in my project?
it is not mdi application
i have tried application.openforms its not working!
|
|
|
|
|
If you create a new form, put it in a collection.
For example :
List forms = new List();
Form form1 = new Form();
forms.Add(form1);
You can iterate it in this collection.
|
|
|
|
|
but , i want to get all of the forms in the project without creating object first,
i tried
foreach (Form frm in Application.OpenForms)
but it just returns the opend forms only!
|
|
|
|
|
When you say "get all of the forms in the project" do you mean all the forms in a Visual Studio project, or all of the forms in a running application? The latter will require using reflection.
only two letters away from being an asset
|
|
|
|
|
Hi, i'm new in developing with C#.net, antill now i've create simple application fo general porpose but now i'm going to crate an application to read and display shapefile produced by gis software such ESRI software.
I've downloaded the specification of shapefiles and i'm building reading API from my self, but i'd like to know if you know some examles, codes, or else that has been already developed.
I've found some library but i can't understand well the licence term and if i can resell my software that are using those library. Moreover i still don't know the right approach to develope in gis software, if you have any advise it's appriciate.
Thanks
Manuel
|
|
|
|
|
Can i create add in for outlook 2002 in VS2005
wasim khan
|
|
|
|
|
Sorry, i am not answering your problem , but can i know have you developed any addins in excel 2003 sp3 using .net 2008 or .net 2005 and deploy in any of client's computer
|
|
|
|
|
Thanx for ur kind reply i already created add in for Outlook2003 using Vs2005 VSTO but my problem is Outlook2002
wasim khan
|
|
|
|
|
Hello everybody,
i have a view that contain data from many tables.
i have added a field to a specific table, and when i make a run for that views,i Remarque that a column contain values for other column. it was similar to a push of columns but without the push of the column header
best regards
dghdfghdfghdfghdgh
|
|
|
|
|
I"m sorry, is there a question here ? Your next to useless header ( there is no SQL in your post ), makes me think whatever it is, if expressed lucidly, probably belongs in the SQL forum.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hello!
My windows mobile program uses the serial bt to get data from a device (bt slave). We open a com port to send and read data. This all works fine.
But the unaesthetic part and the thing I want to change is:
Each time I try to open the COM port the mobile displays the pin request for the device - sometimes also the whole pairing process for the device shows up.
Does anybody has experience or an idea how I could eliminate the pin request?
I'd like to finish the program as comfortable as possible.
Thanks for help!
Beat
|
|
|
|
|
I have managed to create the PDF programmatically by using 'Acrobat Distiller' printer and Word Application PrintOut method but when i open it using adobe ot gives me error 'it is either not a supported file type or because the file has been corrupted'.
Thanx in advance
|
|
|
|
|
I guess you've not really created a PDF at all then, have you ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
its showing a pdf but definitely there is a problem.This is how i created a pdf
<br />
string printerName = oWord.ActivePrinter;<br />
oWord.ActivePrinter = "Acrobat Distiller";<br />
oWord.PrintOut(ref missing, ref missing, ref missing, ref outputFile2, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);<br />
oWord.ActivePrinter = printerName;<br />
oWord.Documents.Close(ref missing, ref missing, ref missing);<br />
oWordDoc = null;<br />
//////where oWord is 'Word.Application'///////////
//////where oWordDoc is 'Word.Document'///////////
//////outputFile2 is a pdfpath////////////////////
///// object missing = System.Type.Missing///////
|
|
|
|
|
hi freind can any body tell me that how i can create addin for Outlook 2002 in VS2005 if yest then how
wasim khan
|
|
|
|
|
Hi all,
I want to store the contents changes of my windows controls in a database. Therefore I determined the name of the object in the control_enter_method and save the name and value as string. Later in the case of canceling the changes I want to reassign the stored values from database back to the controls.
How can I reference the control object by it's name (stored as string) ?
My idea was
object obj;
((TextBox)obj).Name = stored_obj_name;
((TextBox)obj).Text = stored_value;
but this does not work.
what's to do ?
Tnx in advance
Frank
|
|
|
|
|
If you control name, you can access Controls property of a Form class using an indexer that takes string as an input.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
just to put an example with Giorgi's reply
this.Controls["textBox1"].Text = "Hello World";
|
|
|
|
|
Hi Giorgi,
thanks for the reply.
Is that the right solution to get the index ?
I tried this
int index = this.Controls.IndexOf((TextBox)sender);
but get always index = -1;
Where is my fault ?
Tnx Frank
|
|
|
|
|
int index = this.Controls.IndexOf(textBox1);
works for me, where is your code, what is the sender?
int index = this.Controls.IndexOf(null);
gives me -1, so it sounds like you are not passing in a textbox that is in the Controls collection
|
|
|
|
|
The sender comes from the Textbox control enter method
The Enter_Control method is in the Form class where also the Textbox exists.
private void Enter_Control(object sender, System.EventArgs e)
{
try
{
switch(sender.GetType().ToString())
{
case ("System.Windows.Forms.TextBox"):
int index = this.Controls.IndexOf((TextBox)sender);
this.Controls[index].BackColor= Color.Blue;
break;
}
}
catch{}
}
Tnx
Frank
|
|
|
|
|
You can do it like this:
private void Enter_Control(object sender, System.EventArgs e)
{
if (sender is TextBox)
{
((TextBox)sender).BackColor = Color.Blue;
}
}
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
Hi Giorgi,
I had to break the discussion yesterday ...
My code should only test that I have got the right index of the selected control and set the backcolor in this "long way" as test that it works. But the problem already exists, that I don't get an index != -1. This is main funcion of my method
int index = this.Controls.IndexOf((TextBox)sender);
tnx Frank
|
|
|
|
|
Is the textbox on the form itself or is it on the panel or groupbbox or any other container? If yes, then instead of this.Controls you should have the container that contains your textbox.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|