|
I'm using ClickOnce for deploying my smartclient (CAB) application. There are a lot of modules in my applications. When the new version of those modules have been deployed, I wanna show the list of modules that need to be updated to the user before downloading those latest version.. ( like Firefox extension's auto-updates style )
My question is: How can I get the list of latest module?
Thanks in advance.
|
|
|
|
|
hi all
plz help me
i am inserting date to the text box on the datagrid template.There is 2 column for that. one receive date and the other due date. due date should be greater than receive date. and the date format is dd/mm/yyyy. how to validate this. since the date format is dd.mm.yyyy, am not able to compare it with different month.plz help me to solve this. am doing this from past 4 days. but didnt end up with a solution
sample code is given below
if(((TextBox)(dgDetailData.Items[total].Cells[7].Controls[1])).Text != "")
{
try
{
DateTime txt=Convert.ToDateTime(((TextBox)(dgDetailData.Items[total].Cells[6].Controls[1])).Text);
DateTime tst=Convert.ToDateTime(((TextBox)(dgDetailData.Items[total].Cells[7].Controls[1])).Text);
string date=month+"/"+day+"/"+year;
if(DateTime.Compare(txt,tst)>0)
{
lblmsg.Text="error";
lbl1.Text=date.ToString();
}
else
{
lbl1.Text=txt.ToString();
InsertParam[9].Value=Production.FORMATYMONDTIME(((TextBox)(dgDetailData.Items[total].Cells[7].Controls[1])).Text);
}
}
catch(Exception err)
{
RegisterStartupScript("startup","<script>window.alert('1.Error:"+err.ToString()+"')</script>");
}
}
else
{
InsertParam[9].Value=DBNull.Value;
}
In this code the error occuring is if the received date is 01/10/2007 n due date id 30/09/2007, it is inserting value. if it is of same month it is working properly. ie 01/10/2007 n 10/10/2007 it accept and if it is 10/10/2007 n 01/10/2007 it is not accepting.
|
|
|
|
|
Hey all,
I've long been using CodeProject as a valuable resource, but have come to a problem that I can't find a solution for.
I have a .NET 2.0 app, written entirely in C#. In it, I have several controls (some simple, some complex), which I'd like to display detailed data about in a custom tooltip. I've got the tooltip content done and can easily make it be a Form or UserControl, whichever the tooltip class would need.
Ideally, I'm looking for some free class, where I can just do something like...
<br />
WonderfulToolTip tip = new WonderfulToolTip(myTooltipContentControl);<br />
<br />
...<br />
<br />
tip.Show(new Point(300, 400));<br />
<br />
...<br />
<br />
tip.Hide();<br />
I've looked around here, and other websites, and seen at least example of this working, however it wasn't free, and the code seemed way too in-depth, since it was a full control library, and I wouldn't be able to pick out just part I need. I found several different related options, like comboboxes with custom tooltips, or specific custom tooltips that didn't allow you to provide your own control. I know the funcitonality is there, but untangling it from the mess of things that aren't what I want seems very daunting. I've been a .NET C# developer from the start, so my eyes tend to glaze over when I see a huge chunk of code filled with windows API calls, endless enums, and other native code. I'd prefer not to reference any huge control libraries; I'd just like a class or two to add to my project.
Perhaps the desire for a simple custom tooltip class is a bit idealic, I'm not sure. Can anyone point me to the closest I can get, if nothing like what I'm looking for is available? Thanks very much for your time!
|
|
|
|
|
Will the MouseHover event suffice?
|
|
|
|
|
I'm not sure what you mean. I may use MouseHover to trigger when to show the tooltip, but I'm looking for how to display a usercontrol as a tooltip.
|
|
|
|
|
|
Yeah, I have. I'm looking for something I can add to my C# project, so either C# of VB.NET (I could translate it from VB fairly well, or use VS's converter).
|
|
|
|
|
Any other ideas? Could really use something simple.
|
|
|
|
|
While I haven't found what I was looking for, I did find another solution.
I had thought that the built-in System.Windows.Forms.Tooltip class handled text only... And basically that's true. But I just noticed (Thanks PNelson!) that it's got OwnerDraw functionality, so I'll just draw it myself.
|
|
|
|
|
txtInterestRate.Text.ToString = 12;
What am I doing wrong???
Im currently a student, trying to complete a task...and im stuck!
The code is currently under a method in my application.
Help Please
Im trying to set the InterestRate textbox value to 12.
|
|
|
|
|
OlieColie wrote: txtInterestRate.Text.ToString = 12;
What am I doing wrong???
Well, Text already returns a string , so there is no point in asking it to make a string from something that already is a string . It would be pointless.
You want to make the number a string, so perhaps you might want to write 12.ToString() , but if you are dealing with literal values, why not just say "12" and be done with it.
|
|
|
|
|
You have asked this at least three times across at least two forums. Please ask once in the right forum, and leave it at that.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Indeed, only post once.
Just to clarify, ToString() is a function that returns the value of an object, as a string, and it can't be set.
The TextBox.Text property is all you need, it is the text of the text box, so you can either do
txtInterestRate.Text = 12.ToString();
or simply
txtInterestRate.Text = "12";
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
My favorite word is still Callipygian.
|
|
|
|
|
Hi - I mean no disrespect to you in this post.
1 - you are a student, so I assume you are being 'taught'.
2 - the first chapter in most, if not all, C# beginner book handles strings, usually in the form string.Format("{0}" , 12) and, like the previous answers, obj.ToString() .
3 - are you paying for your course, and at what institution?
4 - Do you have any C# books?
I can't believe, in all honesty, that a C# student, would not have been taught how to convert a number to a string.
Seriously, how much are you actually taught, and how much are you left to figure out on your own, and are you given any learning material, or even any pointers on how to find out his info for yourself?
Vote me down if you want, but this is not meant as abuse - just pure curiousity at what is being taught.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
txtInterestRate.Text="12";
try this
|
|
|
|
|
How do I set a textbox value to 12.
I tried the ToString method, but it did not work.
|
|
|
|
|
value? you probably mean TextBox.Text which holds a string; if you want to convert
that to some other type, you probably need a Parse or better yet TryParse method
(see int, double, DateTime... classes).
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
|
hi
please help me I want to inset new rows in the DataGrid in C# in developing SmartDeviceApplications using visualstudio.net2005 to develop an application but i until this time cann't insert new rows into the datagrid nevertheless i can select data from tables into the datagrid but I cann't edit or add new row into this datagrid pleaaaaaaaaaaaaaaaaaaaaaaaaaaaaase help me.
|
|
|
|
|
Hi all,
I'm a new programmer and I've come across a problem that I'll need some help in.
class MyObject1{...}
class MyObject2{...}
class MyObject3{...}
class MyObject4{...}
public void test(object a){
Type a = a.GetType();
//Now what?!
}
//Somewhere in main...I call test and pass it an instance of one of these objects...
test(new MyObject1());
test(new MyObject4());
test(new MyObject3());
test(new MyObject2());
What I'd like to know is how to convert variable 'a' into whatever object was passed into test();
This is probably a silly question but I'm learning....
Thanks in advance.
Humble.
|
|
|
|
|
Try to write a more useful subject line, that says something about your question. We're in the C# forum, so mentioning that in the subject is quite superflous. Almost everyone that starts a thread here need help, so that doesn't do anything at all to distinguish your thread from others.
To get a reference of a specific type, just cast the object reference:
if (a is MyObject1) {
MyObject1 a1 = (MyObject1)a;
}
or:
MyObject1 a1 = a as MyObject1;
if (a1 != null) {
}
As the reference has to be the exact type, there is no solution that handles any type. You have to write code to handle each type separately.
If the classes are supposed to work in a similar way, you might want to create a base class or an interface that defines some common methods, and make all the classes inherit the base class or interface. That way you can use a reference to the base class or the interface instead of a reference to the common base class Object .
---
single minded; short sighted; long gone;
|
|
|
|
|
Just to add - the difference between (MyObject)a and a as MyObject is that the first throws an exception and the second returns null if the cast is invalid.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
I tried to use 'as' today and the compiler slapped me in the face (ie. it told me i was wrong)
It was just like this:
class something
{
//some private variables and whatnot
}
static void Main(string[] args)
{
object test = new something();
something newSomething = test as something;
}
and shwam, compiler throws som error.
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
what was the error ?
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|