|
When you used the 'e-mail this person' link, you didn't fill in your e-mail address so I can't reply via e-mail.
To answer your question, yes; to use the controls like that the end-user must have the .NET framework installed. That technique also only works in IE.
James
Sig code stolen from David Wulff
|
|
|
|
|
Thanks very much for your response.
(In fact I just wanted to make a Reply and have made a 'e-mail this person' by error.)
|
|
|
|
|
Hi,
Is there any way how to insert class derived from Windows.Forms.UserControl (or Control ) to Web page ?
I am not talking about Asp.Net and i do not want to use it.
(Asp.Net is great but i need to react to users input very fast without downloading web page again)
I mean something like inserting (ActiveX conctol or Java applet) in the Web page.
(I do not need to install this from web - everybody who will enter this page can have installed .Net framework and anything else).
Thanks
/* I'm sorry about my english but i hope you can understand this */
|
|
|
|
|
Tomas Petricek wrote:
mean something like inserting (ActiveX conctol or Java applet) in the Web page.
I suppose you could either go with the Java applet or an ActiveX control (which I believe you would probably do in ATL). Does this help. Regardless of whether or not the end user has the .NET Framework or not, this is not required for a client if it is a web page that is being viewed. ActiveX controls download as plugins to the IE browser only. Hope this helps.
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
Yes it is possible, this code should do it (put it on your web page)
<object id="myCtl"
classid="http://www.mycode.Microsoft.com/mycode.dll#myClass"
</object> This requires that you create a class library and put the control named myClass in it. myCtl is a client side name so you can manipulate the control with script.
HTH,
James
Sig code stolen from David Wulff
|
|
|
|
|
Wow
This is exactly what i wanted
Than you
|
|
|
|
|
I like this!;P
But i have another little problem with this:
I don't know how to handle events of this control.
i know how to change properties of this using <param>:
<param name="Text" value="ButtonText">
or using JavaScript:
myCtl.Text='NewBtnTex';
But i do not know if i can handle events and (if it is possible) how to do it
Thank you
|
|
|
|
|
Google for "SimpleControl".
Then google for "Chris Sells", because he's written a few articles on this subject (MSDN and MSDN magazine) Also look at http://www.sellsbrothers.com/wahoo[^],
Make sure you know something about .Net code access security, permissions and codegroups, because you're gonna see security permission exceptions...
VictorV
|
|
|
|
|
When authoring custom controls it is possible to specify a custom (16x16) bitmap that will then be displayed for the control in the Toolbox. However, if you specify a file path (like @"C:\MyProject\resources\toolbox.bmp") it appears the VS.net looks for that file at the specified location at runtime rather than building the image into the control.
Obvioulsy after redistributing the control, the bitmap does not exist any more as they don't have the source code, or if they do they probably don't have it in the same location as the author.
How can I successfully specify a custom bitmap, but be able to redistribute the control?
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
The easiest way to achieve this is to not bother using the ToolboxBitmap attribute and just include a bitmap in the project (at the same level) for each control named the same as the control class, i.e. MyControl.bmp for MyControl.cs.
Be sure to set the 'Build Action' to 'Embedded Resource' for the bitmaps.
Then the Toolbox will automatically use that image.
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
Hey Folks,
I initaly posted this in the C# group but realised that this may be more appropiate here.
I have a few old (very handy) programs that I have written using perl and python that I want to port to C# just for the sake of doing it.
In one of the instances, I need to enumorate across a directory and get the the total size of the files in the directory. Using a simple "foreach" loop like:
<br />
long total = 0;<br />
...<br />
...<br />
foreach(FileInfo f in directory.GetFiles())<br />
{<br />
total += f.Lenght;<br />
}<br />
...<br />
...<br />
And I have to say that this is SLOW. When recursing medium to large directories it can take as much as 10x the time my perl and python programs take.
My guess is that it is due to fact that the call to the Length property is not so light-weight as one might think. So, the call inside the loop is killing me.
Has anybody else ran into this hiccup?
And, does anybody have any suggestions about how to design around this?
Any help would be appreciated
Many Thanks
Chris
|
|
|
|
|
Hi Folks
Is there any library , class or assembley in .NET framework by which to obtain free disk space of a hard drive?
What do you think about: System.Management.Management object?
Please guide me.
thanks
arash
Arash Afifi
Software Engineer
E-mail: afifi@sympatico.ca
|
|
|
|
|
already answered[^].
How low can you go ? (MS retrofuck)
|
|
|
|
|
I have a form that binds controls to a dataset. Some of the fields in the dataset are date fields, so I am using DateTimePicker controls to display (and allow editing of) these fields.
However, the date field in question can be null. When this occurs navigation through the records in the dataset is stopped, that is setting the Position property on the BindingContext does not update the controls.
Is there a workaround that allows binding to null dates?
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
Hi
How about modifying your dataset to insert a date as a default value, in case the field is NULL? Just a thought, mite work, mite not
Cheers
"There are no stupid question's, just stupid people."
|
|
|
|
|
Thanks for the idea, unfortunately a null date has meaning, so actually displaying a date would be confusing and misleading to the user.
Any other ideas?
I'm beginning to think I may have to do this myself. Any ideas what's involved in creating a data bound control?
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
Hi again Derek
I just ran into a similar problem , but I have found a solution for binding a NULL value. Look at the following:
private byte rating;
[Bindable(true)]
public object Rating
{
get { return rating;}
set {
if (value == DBNull.Value) rating = 0;
else rating = (byte)value;
}
}
Hope this helps
"There are no stupid question's, just stupid people."
|
|
|
|
|
Q313513[^] might help. The code's in VB.NET, but it shouldn't be too hard to convert.
|
|
|
|
|
Better yet, here's some C# code that seems to work:
using System;
using System.Windows.Forms;
public class DateTimeBinding : Binding
{
public DateTimeBinding(string propertyName, object dataSource, string dataMember)
: base(propertyName, dataSource, dataMember)
{}
protected override void OnFormat(ConvertEventArgs e)
{
if (e.DesiredType == typeof(DateTime))
{
if (e.Value is DBNull)
e.Value = DateTimePicker.MinDateTime;
}
else if (e.DesiredType == typeof(bool))
{
if (e.Value is DBNull)
e.Value = false;
else
e.Value = true;
}
base.OnFormat(e);
}
protected override void OnParse(ConvertEventArgs e)
{
if (e.DesiredType == typeof(DateTime)
&& e.Value is DateTime
&& (DateTime)e.Value == DateTimePicker.MinDateTime)
e.Value = DBNull.Value;
else if (e.DesiredType == typeof(bool)
&& e.Value is bool
&& (bool)e.Value == false)
e.Value = DBNull.Value;
base.OnParse(e);
}
}
Then, you just need to add the appropriate bindings:
dtp.ShowCheckBox = true;
dtp.DataBindings.Add(new DateTimeBinding("Value", ds, "[Date Field]"));
dtp.DataBindings.Add(new DateTimeBinding("Checked", ds, "[Date Field]"));
I haven't tested updating the data, but the display seems to work fine.
|
|
|
|
|
Thanks, I'll take a look and let you know how I get on.
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
Thanks very much (once again). I've had chance to try this out now and it certainly seems to work (though like you I haven't tested updating yet).
One thing that would make it a perfect (for me anyway) implementation was if the DateTimePicker.Text property could be set to "(null)" for null dates. Any ideas how to do that?
I tried setting this.Control.Text in the OnFormat override, but that caused the original problem to occur again Any ideas?
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
|
I have an Access database that I'm trying to bind to in a Windows Form.
I've added all the necessary connections, data adapters and datasets and establish relations in the schema.
Unfortunately the table I want to be able to navigate and edit includes several fields that are lookups to other tables. I have the main table fields working fine with navigation done using the BindingContext Position property and I can bind a combo box to the lookup table to give the right values, but how do I get the lookup combo to display the correct value for the current record in the main table?
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
Hi,
When I upload a file via ASP.NET HTTPPostedFile.SaveAs(foo.jpg)
The file foo.jpg is locked by another process for approx. 30 seconds.
I have ruled out;
VS.NET being in Debug Mode
AntiVirus Software...
I was just wondering if anyone else has run into this problem and if they found a remedy ?
Thanks in Advance
Angus Logan
|
|
|
|
|
Hi Angus,
Try to make Windows Indexing Service Manual. I had a similar problem that after every 'Build' Operation, my Web Application complained
'Access to /Temporary ASP.NET ... denied.' A suggestion in one of the forums suggested that if Indexing Service is enabled, it tries to index the newly built files from Visual Studio and during this period, the files are not accessible.
Most probably, the same scenario applies to you too. Just after call the PostedFile.SaveAs, the Indexing Service tries to index the newly created resource, resulting in a deadlock for your application from accessing the same.
Making Indexing Service Manual or stopping it should help you too.
Deepak Kumar Vasudevan
|
|
|
|