|
10x ... working.
But other is the problem
MyTextBox inherit a class MTextBox who have a TextBox mtb = new TextBox(); and a property Mtb
and when I create MyTextBox myTB = new MyTextBox(); and put it into the propertyGrid the myTB, I can see the Mtb property who have the exact property of an TextBox object.
I want to not see the Mtb in my propertyGrid ... and I tried with [Browsable(false)] and it isn't work.
Do u think it's another solution?
10x
|
|
|
|
|
verify....
so you placed this code into your MTextBox class ?
private textBox mtb;
[Browsable(false)]
public textBox Mtb
{
get { return mtb;}
set { mtb = value;}
}
that should work..
Not sure but otherwise override the methode in your MyTextBox class and do the same...
|
|
|
|
|
This is the base class:
public abstract class MgrComponentBase
{
Control _baseControl = new Control();
[Browsable(false)]
public Control BaseControl
{
get { return _baseControl; }
set { _baseControl = value; }
}
[CategoryAttribute("Properties"), DescriptionAttribute("Something")]
public string ComponentName
{
get { return BaseControl.Name; }
set { BaseControl.Name = value; }
}
...
This is the second Class:
public class MgrTextBox : MgrComponentBase
{
string _label;
string _tooltipText;
[Browsable(false)]
public MgrTextBox()
{
BaseControl = new System.Windows.Forms.TextBox();
}
public System.Drawing.Color BackgroundColor
{
get { return BaseControl.BackColor; }
set { BaseControl.BackColor = value; }
}
public System.Windows.Forms.TextBox TextBox
{
get { return (TextBox)BaseControl; }
set { BaseControl = value; }
}
...
and doesn't work.
|
|
|
|
|
this one is not neccessary for the constructor..
[Browsable(false)]
public MgrTextBox()
{
BaseControl = new System.Windows.Forms.TextBox();
}
what if youset the propertygrid to the MgrComponentBase
class??
i think overriding the BaseControl property in the MgrTextBox class should help you..
[Browsable(false)]
public override Control BaseControl
or
[Browsable(false)]
public new Control BaseControl
{
get { return base.baseControl; }
set { base.baseControl = value; }
}
|
|
|
|
|
Hi,
I have loaded a dataset with a table that contains 1000 records. so far so good.
When loaded i assign my Datagridview.Datasource event with the table, but this takes 4 seconds before i actualy see the records in my grid.
DgvCardHolders.DataSource = DsCardHolders.Tables[0];
Does someone have an idea how to show the progress of this load ?
i suppose the datagridview is copying the data from the datatable.
Thx
Kurt
|
|
|
|
|
Okay,
here i am again....
2 posibilities...
THE PROBLEM :
The property AutosizecolumnsMode was set to Allcells and that's whats making it slow.. so i set it to Alldisplayedcells and guess, no performance problem at all.... over 3000 records in no time on screen.. (so don't tell me delphi is faster now...no way.. just do it the right way.)
STILL WANTS A PROGRESS BAR :
If u still want to use AllCells and show a progress bar a solution is using virtualmode. Switch the property on and use the cellvalueneeded event to fill in the grid values.. in this event you can calculate the progress using the e.index and the row.count and show it on screen while loading. Don't use the Datasource property in this case.
Greetz
Kurt
Belgium.
|
|
|
|
|
Hello, I have a control, that creates a dialog using ShowDialog() method of a Form class. The problem is that sometimes it happens, that another application shows instead of the created dialog. I have tried passing null as an active window should be used. Tried passing the control, that creates the dialog, but no better, the window dissappears. Now I'm just experimenting with BringToFront(), Activate(), but no luck.
Any help would be appreciated, thanks a lot for your time ...
|
|
|
|
|
Maybe settings your own application topmost at that moment ???
your application and your dialog will remain on top of all other windows..
otherwise search for main windowhandles of other apps and hide them by a windowsmessage, but thats a lot of work i guess...
greetz
|
|
|
|
|
Hi
I have written an application in which on left side there are oulook style menu.When i click anyone from that menu a new child form open in panel control of parent form.
My problem is that this child form is not getting focus .i HAVE ALSO TRIED .FOCUS AND .SELECT methods.
if i donot add this child form in panel control then form gets focus but on maximizing child form it also covers the area of left created menus.
So how i can get focus on child form in panel control ? or how i restrict child form not extend from specified left position on maximization.
I am using Visual Studio 2005 c# windows form
|
|
|
|
|
myChildForm.Activate();
Geniality is in simplicity.
|
|
|
|
|
Yes i tried this one also but child form not getting focus in panel
|
|
|
|
|
Also note that if there is text box on child form and in this scnerio if you click text box you can type text in it but cannot select the text in textbox by simply mouse selection(draging mouse).
|
|
|
|
|
I'm trying to write a dll in C#, but when I try to register it with regsvr32 I get the error message: "xyz.dll was loaded but dllregisterserver entry point was not found"
Thanks for any help
|
|
|
|
|
Into AssemblyInfo.cs ( or elsewhere put this piece of code ).
[assembly: ComVisible(true)]<br />
<br />
[assembly: Guid("b8e616b6-9213-4103-af65-8965422566b3")]
Geniality is in simplicity.
|
|
|
|
|
this is already done, but still isn't working
|
|
|
|
|
Are you sure, the "ComVisible" attribute are set on "true"? Default value is "false".
Maybe, this KB will help you: http://support.microsoft.com/?scid=kb%3Ben-us%3B249873&x=11&y=9
Geniality is in simplicity.
|
|
|
|
|
This is the code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Management;
using System.Runtime.InteropServices;
namespace register
{
public interface reg_inter
{
string procId();
}
[ComVisible(true)]
public class reg:reg_inter
{
public reg()
{
}
public string procId()
{
ManagementObjectSearcher search =
new ManagementObjectSearcher("select * from win32_processor");
foreach (ManagementObject wmi in search.Get())
{
PropertyDataCollection prC = wmi.Properties;
foreach (PropertyData pr in prC)
{
if (pr.Name == "ProcessorId")
{
return pr.Value.ToString();
}
}
}
return "0";
}
}
}
and this is assemblyinfo.cs:
.
.
.
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(true)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3ea648c1-75cf-4d96-9978-d615378e027c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Where am I wrong?
|
|
|
|
|
OleDbConnection connect=new OleDbConnection();
connect.ConnectionString="Provider=DB2OLEDB; initial catalog=SAMPLE;integrated security=SSPI,user id=db2admin;password=eugene09";
connect.Open();
OleDbCommand cmd_save =new OleDbCommand("INSERT INTO test(name,year,course)"+"VALUES("+"'"+textBox1.Text+"'"+","+"'"+textBox2.Text+"'"+","+"'"+textBox3.Text+"'"+")",connect);
int intRow=cmd_save.ExecuteNonQuery();
if(intRow>0)
{
MessageBox.Show("Record added");
}
connect.Close();
this is a program i created adding a record in the database but their is no error but an exception, saying " DB2OLEDB is not existing in the local machine."
i think the problem is in the insert command. thanks for all the help!
|
|
|
|
|
icesha wrote: an exception, saying " DB2OLEDB is not existing in the local machine."
i think the problem is in the insert command. thanks for all the help!
The error message (incorrectly copied as it is) suggests the connection in the source of the problem. Have you installed DB2 on your local machine?
|
|
|
|
|
How to create a simple alarm application in C#..
|
|
|
|
|
iamdking wrote: How to create a simple alarm application in C#..
Take your problem, then break it in to smaller parts then implement the smaller parts. If the smaller parts are still too big then break it down further until you get to a point where you can create a "simple alarm application".
Now, we can help on specific elements of your application, but we cannot help with a whole application in a forum post.
Also, what do you mean by "a simple alarm"?
The following code could be perceived to be "a simple alarm":
Thread.Sleep(60000);
Console.WriteLine("Ding! Ding! Ding! Ding!");
|
|
|
|
|
Thanks for d information..
Actulally, I developed a window application in c# in which i have to show a clock and facility to set and ring an alarm on specified time..
|
|
|
|
|
iamdking wrote: I developed
Past tense - so you have finished? (I'll assume you got your tenses confused, otherwise you wouldn't be making this post)
iamdking wrote: i have to show a clock and facility to set and ring an alarm on specified time..
Okay - then break the problem down into smaller parts.
Inputs: current time, alarm time
Outputs: At specified time "ring an alarm"
* The current time can be got from DateTime.Now
* The alarm time will have to be got from somewhere: Where? User input, config file, database, somewhere on the web??
* What do you mean by "ring an alarm"?
|
|
|
|
|
Hi all,
Does anyone know how to import online published Schema in to another schema in Biztalk 2006?
Thanks
|
|
|
|
|
Well, you could use a string builder to iterate over the second group of strings and build it into a single string. There's no automatic way to do it, you need to do it yourself.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|