|
Hi!Nnamdi Onyeyiri,
If we can treat every vc++ code module as a dll?
Thanks
momer
|
|
|
|
|
If you compile your VC++ code to a DLL, exporting the functions you need to use, then you can use p/invoke to run them, yes.
|
|
|
|
|
Hi there,
i wrote an application in VB.NET - its for perhaps 25 Users in a LAN. The appl ist start from any user from the LAN Drive.
The problem is - if a make a update of the application i have to got to any user and increase the 'ASSEMBLY TRUST' for the Assembly.
Is it possible to make a setting in the code which will do an 'assembly trust' automatically??
Thanks
Mike
(WIN2k;VB.NET;ORACLE 9i;Informix)
|
|
|
|
|
Here i have a small doubts to ask you. See you are developing and integrating by the help of source safe ?. To be concise, you are into group development ?.
Sreejith Nair
[ My Articles ]
|
|
|
|
|
no, i am not into group developing. i want to start the finished application from a LAN drive.
It already works - the problem is, if i made a new release of the application, i have to set up the 'assembly trust' into 'full trust' in '.net framework configuration'!?
If i dont do that the programm starts with an run time error!
Thanks
Mike
(WIN2k;VB.NET;ORACLE 9i;Informix)
|
|
|
|
|
The problem is: I want to use a for control sentence to control 16 lables,each time I want to change one lable's Text property.Suppose the 16 lables are lable1,lable2,lable3,...,lable16. What does the code should look like?
|
|
|
|
|
You could make an array of the 16 labels, then just cycle through that array in your For loop
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
Hi!benjymous,
Thank you very much!
Could you tell what the array's type should be? Can you show me the code?
|
|
|
|
|
I'm not on a computer with C# on it atm, but what you need to do is this:
You can find out the type of the label by selecting the label in the form design view and noting down the name of it - then go back into your source and type that name - if you hover the mouse over it, the tooltip should tell you the type - I'm pretty sure it's Label though
Then you can just build the array like you would any other array
e.g.
class MyForm : Form
{
...
Label[] labelList;
const int NumLabels = 5;
...
public MyForm()
{
...
labelList = new Label[] { label1, label2, label3, label4, label5 };
...
}
public void DoSomethingWithLabels()
{
for( int i=0; i<NumLabels; i++ )
{
labelList[i].Text = "Hello World!";
}
}
}
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
hi!benjymous,
Thank you for your futher explanation.Now I know how to deal with it.
public System.Windows.Forms.Control[] mylables;
mylables = new System.Windows.Forms.Control[]{this.lusb1,this.lusb2,this.lusb3,this.lusb4,this.lusb5, this.lusb6,this.lusb7,this.lusb8,this.lusb9, this.lusb10,this.lusb11,this.lusb12,this.lusb13, this.lusb14,this.lusb15,this.lusb16};
I treat the mylables just as a Control.It also works.
|
|
|
|
|
If you do a foreach loop for all controls in your form, in example,
foreach (Control myControl in System.Forms.Controls)
{
}
make sure you do a type cast on myControl object to a label, so you can set properties on it. For loops can be nice but if you dont want to hard code a specific number of labels then you can go ahead with a foreach loop.
Niklas Henricson
System Developer
Sweden
|
|
|
|
|
Hey,
I've used C# and VB.NET in my solution and both languages integrate pretty well. However, can I include C++ code in the same solution also? I mean can i create a C++ class and access it from my VB.NET or C# projects?
|
|
|
|
|
You mean to say you want to access the code which is developed in C++ here in Vb.Net or C# solution. We can use unmanaged code to our managed environment using some techinics called ComInterop,P/Invoke.
You can go for any of these techinics to use your unmanaged code here managed environment.
Sreejith Nair
[ My Articles ]
|
|
|
|
|
Is there an example I can look at? Do I need to compile the C++ class to a dll or can I access the methods directly by just referencing the C++ project in the VB.NET project?
This can easily be done between C# and VB.NET...but is it the same with VB.NET and C++?
|
|
|
|
|
|
Has anybody tried implementing GLOBAL cbt hooks in .net?
I keep getting a .net framework runtime error as soon as the hook is activated...however it works fine LOCALY...
I just keep getting the command prompt screen with a "Runtime" error message i hate it!
|
|
|
|
|
Hi,
I have a base class A. I subclass A to create B, and add some properties to B. I need to know in A, when any of the properties in B have changed, without having to implement code in B's set methods. B will be created and maintained by my customers, I will only provide A for them to extend. I will never have access to modify the code for B which is what they will be creating.
What I'm looking for is some kind of global/system event in .Net that will notify the base class A that B's properties have changed.
Any help will be greatly appreciated!
tx,
Gideon
|
|
|
|
|
Go for containment class. That may the best choice for you.
Sreejith Nair
[ My Articles ]
|
|
|
|
|
I think you are familier with inheritance. See here we can go for two type of inheritance relation.IS-A and HAS-A. IS-A relation is our normal classical inheritance.And HAS-A relation is called Containment type of relation. Here relation means from base to derived.
Simply put; if a class contain another class defanision. So here we have total two classes and one contain the other. Suppose if you try to access the contained class from somewhere say some other class, it won't allow u to do that. And one more thing is there suppose if container class want to access the contained class.Here the container class need to declare a private contained class type.
I know it is not sufficient for you.But time not allowing me to do that. Better try to search for 'Has-A' relation or containement in popular search engins.
If you are not getting any stuffs after searching then please let me know that.;)
Sreejith Nair
[ My Articles ]
|
|
|
|
|
Hi all!
I have a DataGrid that displays a table with 3 columns: ID, Name, Active.
Active is a checkbox. How can I achive, that first 2 columns are NOT
editable, but the last one is.
Thanks for the answers,
Jani
|
|
|
|
|
DataGridColumnStyle.ReadOnly Property
Gets or sets a value indicating whether the data in the column can be edited.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWindowsFormsDataGridColumnStyleClassReadOnlyTopic.asp
|
|
|
|
|
isn't there a property called 'enable' or something like that for the grid. Basically u want the first two columns read only? i'm pretty sure that u can set that in the grid's property.
*HyVong*
|
|
|
|
|
Hi,
My windows form app shows the main form by instantiating the form, then calling ShowDialog. If I display a msgbox in the form.load or form.activated event, the form closes itself. There must be more to it than that, since this did not always happen, but at this point in the project if I comment out the msgbox, the main form comes up fine, and if I leave the msgbox in, the form closes itself.
Any ideas what could be going on here?
Thanks
David
|
|
|
|
|
Hello,
I have a problem with Key-Events on Forms in connection with hitting
the AcceptButton.
Situation:
- MdiChildForm 1 with DataGrid for selecting records. This DataGrid
has AllowNavigation false, ReadOnly true and all the textBoxes of all
the DataGridTextColumns are disabled, too.
The KeyUp-Event of this DataGrid is bound to a method that opens a
second form for editing that selected record when the Enter-key
(KeyValue 13) is used.
- EditForm 2 has Button btnOK for saving the data and closing the
form. The MdiParent of this form is the same as 1's. The AcceptButton
property is set to btnOK.
Hitting Enter in form 2 closes it (ok, that's what I want) and the
next thing happening is the KeyUp-Event in form 1 and hello ... here
is form 2 again (what is absolutely not wanted). There are neither
KeyDown, KeyPress or KeyUp occuring on form 2 before it closes and no
KeyDown or KeyPress on form 1.
How can I get a useful behaviour? Any hints are appreciated.
|
|
|
|
|
Insted of click. Go for double click and write your code in double click event handler. I mean what ever code you are writing inside click event handler, put it as double click event handler.
Sreejith Nair
[ My Articles ]
|
|
|
|