|
|
Christian answered this question for you when you asked it yesterday and Jamie answered it the day before. Please don't repost questions.
You need to understand that people here will normally give you the hints/areas that you need to look at in order to complete your task. They will not give you the complete application. You are expected to do some work on your own, and having been told to look at office Interop it is not unreasonable to think that you will have used <<insert search="" engine="" of="" choice="" here="">> to research the topic. If you have a problem with code then tell us what you have done, where the problems are and what they are. At that stage, we will be able to provide more help.
|
|
|
|
|
Hi,
I have tried to write a cookie then read it. If it return true, meaning that the user's cookies is enabled and if it return false, that mean the cookies has been disabled. Unfortunately, when I turn my cookies off using IE, I was clueless when it always return me true. I have tested the same project with Firefox, it works pretty well!
Please help~
below is a part of my code in C#:
HttpCookie c;
if (!Page.IsPostBack)
{
if (HttpContext.Current.Request.Cookies["TestCookie"] != null)
{
c = Request.Cookies["TestCookie"];
c.Expires = DateTime.Today.AddDays(1);
c.Values.Add("testing","testing");
}
else
{
c = new HttpCookie("TestCookie");
c.Expires = DateTime.Today.AddDays(1);
c.Values.Add("testing","testing");
}
Response.Cookies.Add(c);
c = null;
}
if (Page.IsPostBack)
{
if (HttpContext.Current.Request.Cookies["TestCookie"] != null)
{
c = Request.Cookies["TestCookie"];
Response.Write("Cookie Enable");
}
else
{
Response.Write("Cookie Disable");
}
}
|
|
|
|
|
For me it is working fine
sharath Chandra
|
|
|
|
|
I want a RowHeaderCell displaying a Value only and no glyphs whatsoever.
The problem i'm facing is the Selection glyph and the space the icons seem to claim.
Is there a DisableAllGlyphsAndReclaimSpace-property available I haven't discovered yet?
I also noticed a bunch of Non-Public members:
DATAGRIDVIEWROWHEADERCELL_contentMarginHeight up to DATAGRIDVIEWROWHEADERCELL_verticalTextMargin
I think they also have something to do with it.
|
|
|
|
|
Hello,
i have 2 problems
i've created a .Net hosted control library which should run with explorer, and it loads when i'm starting html page
but when it tries to work with files, Runtime throws an exception
1) Could you write how-to configure my DLL in .Net framework mmc
(it shows messages that strong name required and so on)
2) I have a public available
event OnCompile(string text)
and a public available variable
oncompile
but when i'm trying to add an event handler to my .Net control in Java script
like
document.supercontrol.oncompile = javascriptproc
function javascriptproc(text)
{
document.write(text);
}
it doesn't work
Thank's
|
|
|
|
|
Hi all,
depending on an access level of my app's I want to suppress a statechange of a radiobutton field (without disabling the controls). On a checkbox control I can override the onclick event and use the BeforeStateChange event.
A radiobutton doesn't have such an event.
Who has an idea to do that ?
tnx Frank
fracalifa
|
|
|
|
|
Hello,
You could still override OnClick, and use MouseDown as for the functionality of BeforeStateChange.
Or fire your own event in the OnClick Method.
All the best,
Martin
|
|
|
|
|
Hi,
dont know about BeforeStateChange event, it is not in my MSDN documentation.
Same MSDN documentation says one should not use RadioButton.OnClick
for RadioButtons you can set AutoCheck=false and do all the Checked logic
yourself.
I consider it bad practice to change the behavior of a standard Control:
a RadioButton (group) should either be enabled and you can operate it normally,
or disabled and you cant operate it at all. For me there is no way in between.
|
|
|
|
|
Hello Luc,
Luc Pattyn wrote: I consider it bad practice to change the behavior of a standard Control
I don't agree in this point, as I often manipulat standard Controls for my needs.
As "overriding" gives me the chance to change the behavior of controls in the way my "customer" is used to it from machines my company delivered years ago.
And I think the point is, as some people (including me) are not doing WEB Applications or standard Windows Application for PC's, your statement doesn't fit for all.
All the best,
Martin
|
|
|
|
|
Hi Luc,
you are right, sorry, I override the onclick event and created an own event called checkBeforeChange like this
protected override void OnClick(EventArgs e) <br />
{ <br />
if(this.BeforeStateChange != null)<br />
{<br />
this.BeforeStateChange(this, ref cancelStateChg);<br />
}<br />
if(this.cancelStateChg)<br />
{ <br />
this.Checked = !this.Checked;<br />
} <br />
base.OnClick (e);<br />
}<br />
this code is working on a checkbox, but not on a radiobutton.
I would use enable=true/false but the bad is the color change to gray. If I could prevent the colorchange, everything would be fine.
Frank
-- modified at 6:37 Thursday 12th July, 2007
|
|
|
|
|
I understand that, but the basic point is a Control that is disabled MUST
look different; if it did not, the user would manipulate it unknowingly,
and then complain it does not work as expected.
|
|
|
|
|
Hi luc
a disabled control should look different, but in a way I can decide of, and not in the way MS do.
tnx
|
|
|
|
|
Standards are fantastic. Everyone should have one.
|
|
|
|
|
A simple solution is to intercept checkchanged, and set the button back to checked if it is not checked.
Not the most elegant though
|
|
|
|
|
Hello,
fracalifa wrote per e-mail: Hi Martin,
tnx, that works, but how can I prevent the statechange of the radiobutton ? Is there a cancel option which I can use for?
Tnx Frank [confused]
I haven't even found "statechange", is it .NET>1.1?
P.S.: please respond in the forum, cause I'm not answering per e-mail!
All the best,
Martin
|
|
|
|
|
Hi Martin,
other than a checkbox a radiobutton is a group of controls. With the checkbox I can do suppressing the toggle of the state, with the radiobutton(s) I can do not.My wish is to prevent the change of state from uncheched to checked when clicking on it, that's all (without enable = false).
tnx Frank
|
|
|
|
|
But haven't you allready told the solution with overriding the OnClick.
I tested it with an inherited (from RadioButton) control.
private bool _disable = false;
public bool Disable
{
get
{
return _disable;
}
set
{
if(value!=_disable)
{
_disable = value;
}
}
}
protected override void OnClick(EventArgs e)
{
if(!Disable)
base.OnClick (e);
}
Works well for me.
All the best,
Martin
|
|
|
|
|
Yes, that's it,
my fault was the calling of the base class even when it is disabled.
tnx
|
|
|
|
|
Glad I could help!
You are wellcome!
All the best,
Martin
|
|
|
|
|
Hello there,
I have been asked to create a design surface where you can drag and drop controls onto this surface and it will automatically generate the XAML code , now the problem is i have never done this before, so if there is anyone who can help me with this it would be greatly appreciated.
thanks in advance
|
|
|
|
|
|
thanks for the reply,
im actually trying to create a custom IDE like VS that i can drag and drop controls onto a surface and the XAML code for those controls will be generated automatically,
|
|
|
|
|
Well yes, that's what Expression Blend does. It'll probably be cheaper to buy it than putting in vast amounts of time and trouble to create something similar.
Standards are great! Everybody should have one!
|
|
|
|
|
Expression Blend would work but we are looking to create a custom one that we can develop and deploy so that anyone can create a custom application simply by dragging controls onto a design surface
|
|
|
|