|
you said goole maps will work if the pc is online.what should I do if I want to work offline?
then you said somthing about Dundas and you assume it sells maps offline.would you please explain about it?How can I reach to these maps?
|
|
|
|
|
First of all, you got lucky, if I wasn't online, no-one would know what you were talking about.
second, if you're offline, google maps can't work, I said that.
third, the ads for Dundas are on this site all the time, and google is all you need, if you can't work out to try www.dundas.com.
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 )
|
|
|
|
|
Well, it's an updated version that was done and can be found at http://wyday.com/blog/2007/csharp-splitbutton/
anyways, I have it implemented just fine, but I am having difficulty constructing an event handler to deal with the selection that the user makes.
The code works by constructing a a contextMenuStrip, then adds Items to it. I am wondering how do I set up an event handler that takes the chosen item and when the button is clicked, does a particular action. If I can at least get a hint to what I need to implement to set it up, that would be great.
If you need more code, just ask.
Thank you,
Fare
|
|
|
|
|
Ok let's try this again...
(sorry if this violates some sort of double post law)
<<designer class="">>
<br />
this.splitButton.ContextMenuStrip = new<br />
System.Windows.Forms.ContextMenuStrip();<br />
this.splitButton.ContextMenuStrip.Items.Add("Item1");<br />
this.splitButton.ContextMenuStrip.Items.Add("Item2");<br />
this.splitButton.ContextMenuStrip.Items.Add("Item3");<br />
<br />
<br />
this.splitButton.Click += new System.EventHandler(this.cmdSplitButton_Click);<br />
<>
<<splitbutton class="">>
<br />
protected override void OnMouseUp(MouseEventArgs mevent)<br />
{<br />
if (!showSplit)<br />
{<br />
base.OnMouseUp(mevent);<br />
return;<br />
}<br />
<br />
if (mevent.Button == MouseButtons.Right)<br />
{<br />
ShowContextMenuStrip();<br />
}<br />
else if (m_SplitMenu == null || !m_SplitMenu.Visible)<br />
{<br />
SetButtonDrawState();<br />
<br />
if (Bounds.Contains(Parent.PointToClient(Cursor.Position)) && !dropDownRectangle.Contains(mevent.Location))<br />
{<br />
OnClick(new EventArgs());<br />
}<br />
}<br />
}<br />
<>
<>
<br />
private void cmdSvAllImg_Click(object sender, EventArgs e)<br />
{<br />
}<br />
<>
My question is what do I need to do so that when the button is clicked, it does an action that corresponds with the selection of the splitbutton (e.g if the user selected Item1, it would do an Item1 specific job, and Item2 selection would do an Item2 job)
If any other info is needed, just let me know. The splitButton class can be downloaded at http://wyday.com/files/SplitButton.zip
Thank you again,
Anthony Novak
|
|
|
|
|
I've looked at all the properties and tried anchoring it to all the sides. Looked up auto-sizing and found out how to do it for the label but not to make the text in the label enlarge or shrink when I re-size the box. Any ideas?
|
|
|
|
|
You'd need to track the scale change and change the font size yourself.
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'm wondering if there is a way so I don't have to change the font manually every time I wanna change the size of the window.
|
|
|
|
|
I guessed that. I'm saying that I don't believe so.
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 )
|
|
|
|
|
Hi. I'm trying to catch all unhandled exceptions in my application (so they can be logged and the user presented with a "nice" message instead of some confusing "computer-y" message.
I do the following in my WinForm application:
-- In the constructor
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.UnhandledException += new UnhandledExceptionEventHandler(OverAllUnhandledHandler);
-- the method
static void OverAllUnhandledHandler(object sender, UnhandledExceptionEventArgs args)
{
Exception e = (Exception) args.ExceptionObject;
logger.Log(LogLevel.Fatal, e.ToString());
MessageBox.Show("Please check error logs for details", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
If I create a divide by zero error, it is trapped (either in the constructor or in a button click event. I have even created a thread that starts and causes the error; it is still trapped. However, some errors are still popping up in the standard "Microsoft .NET Framework" dialog, with the text "An unhandled exception has occurred in your application.....".
Any idea how to get all unhandled exceptions (I know, code better to catch all exceptions) to be caught by this OverAllUnhandledHandler method?
Thanks for any tips.
--G
|
|
|
|
|
I put my main code in a try/catch and handle threaded exceptions, it's a long time since my app blew up without logging a nice error for me and telling the user of the same.
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 )
|
|
|
|
|
Thanks -- haven't been handling threaded exceptions -- giving that a shot.
Do you mean you put a try/catch around the
Application.Run(formName); in Main() ?
|
|
|
|
|
Yes, that's all I did initially, then as I am multithreaded, I had to add code to handle exceptions in threads.
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 )
|
|
|
|
|
Great. Thanks. I've included both the try/catch and the ThreadException code -- we'll see how it runs this afternoon!
|
|
|
|
|
I handle exceptions using:
AppDomain.UnhandledException,
System.Windows.Forms.Application.ThreadException,
and a catch-all handler in void Main().
This gets all unhandled exceptions (well, except for some that are swallowed by Windows Forms/COM in the Drag* events - put catch handlers in all Drag* event handlers).
|
|
|
|
|
Thanks Daniel -- this is now how the application works (I previously only had AppDomain.UnhandledException, thinking that it would get all unhandled exceptions). Since I don't (currently) do any drag events, I should be OK (but I'll keep it in mind for future projects).
--G
|
|
|
|
|
Hi.
I have a DataGridView, now I want to use edit feature of it.
for save changes to DB, the way that I know is that read all rows of DataGridView and update all rows in DB (even rows that have no changes)
What is better way, that only changes be updated?
Best wishes
|
|
|
|
|
I use this in the CellLeave event to update the underlying dataAdapter. Before calling this however, I loop through the grid to ensure that no values being updated are going to throw up errors.
<br />
dataAdapter.Update(table);<br />
|
|
|
|
|
I hope that sounds right? I will explain...
I have built a class (lets call it 'X') that constructs a StringBuilder and then passes it back. All is OK except within this class it calls a number of methods from a base class higher up.
Here comes the tricky bit. Class 'Z' overrides a number of these base class methods, then calls 'X'.
There are also several versions of 'Z' each doing similar things but with subtle differences.
Question: Is there a way of calling the overridden methods in the parent class 'Z' from the child 'X'...?
Thanks in advance,
Phil
"Rules are for the obedience of fools and the guidance of wise men"
|
|
|
|
|
Phillip Hodges wrote: Is there a way of calling the overridden methods in the parent class 'Z' from the child 'X'...?
Yes, just call them. If they are declared as virtual in the base class and override in the derived class then the correct version will be called. i.e. The version defined in the concrete class. That is to say the version of the real object, not its base.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Thanks for the quick response... Yeah, I made a silly mistake... It is working fine now...
Thanks again,
Phil
"Rules are for the obedience of fools and the guidance of wise men"
|
|
|
|
|
Phillip Hodges wrote: lets call it 'X'
Actually, lets not - it just complicates things and takes therm out of context. Im sure you use a descriptive name in your code (like MyStringCreator or something) so why not use it here to help people understand the context in which you are writing code.
|
|
|
|
|
I have a gridview that contains a checkbox for a user to select his choice.
I want a code that enables user to check all and uncheck the check box at ones
I am using ASP.net and C_sharp.
Please advice
|
|
|
|
|
You want to do this without postback ? You need to write javascript to do it in that case, which is a little involved, you need to get the id's of the input controls, so you can look them up and set their state.
BTW, you should ask in the ASP.NET forum, and only there.
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 )
|
|
|
|
|
Thanks for your time. Yes ,its with out postack.Dont you think it can be done in cSharp.
Thanks
|
|
|
|
|
kibromg wrote: Dont you think it can be done in cSharp.
Of course not. Your C# code is not called unless you do a postback.
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 )
|
|
|
|