|
You're basically going to have to translate the mouse click location into a position on the map. This means that behind the scenes, you are going to have to translate each room into a set of extents and then see which extents the mouse click is in.
|
|
|
|
|
yip, kinda like that. i'm hoping someone can help me in the right direction as far as saving these custom defined areas to database as they are not just simple x,y,height,width measurements... it might be a "freehand" shape. also how, once you have established a scale, to calculate areas etc...
*****
thought of a better way to explain this ... ever seen these automated terminals at the movies. on the touch screen you select the movie you want to see and then you shows you a schematic of "the cinema", the blue squares will (for example) be the "taken seats" and the white square will represent the "available seats". The user can then click on the seats they want to book.
this is effectively what i need to do .. the only addition is that in a cinema the seats are predetermined. My application also need to allow the user to define the number, size and location of the "seats" in a given area/layout.
*****
|
|
|
|
|
I have an WinForm and WebBrowser control on it. WebBrowser generates a NewWindow event (many web links have that settings by default) than I catch it, make it e.Cancel = true .
But the question: how to retrieve full requeted URL
The code:
...<br />
webBrowser.NewWindow += new System.ComponentModel.CancelEventHandler webBrowser_NewWindow);<br />
...<br />
void webBrowser_NewWindow( object sender, System.ComponentModel.CancelEventArgs e ) {<br />
Console.WriteLine("New window" + (sender as WebBrowser).Url.ToString());<br />
e.Cancel = true;<br />
}
Thanks in advance!![Cool | :cool:](https://codeproject.freetls.fastly.net/script/Forums/Images/smiley_cool.gif)
|
|
|
|
|
I had did a project in C# in a machine, now i need to transfer all its files to another machine?When i copied the solution folder and dropped in new machine in a right path? i had installed same version of Vs200 and Sqlserver2005 when i tried to open the same in new machine , i couldnt find my projects Solutin icon in solution explorer? Also i couldnt set a new form created in new machine as startup in the same folder?
Pls help. How to rectify this?
senthil
|
|
|
|
|
Well I never had a problem with just copying the complete folder to a new PC and then opening the solution (that should only contain relative paths) - maybe you are missing some critical files that are located on another folder (for example the solution file?)?
|
|
|
|
|
And that got voted down, guess it wasn't the answer they where looking for.
I also have never had a problem with copying projects. They just work, wherever i put them.
My current favourite word is: Bauble!
-SK Genius
|
|
|
|
|
Hope you are dealing with windows desktop application.If yes then hope below items are matched with items in ur another maching.
.NET Framework
Visual studio XXX
sql server xxx
If u r dealing with Web application then chk out its ISI path as well as virtual directory path.
nJoy .NET
Regards
Chintan
www.visharadsoft.com
(I am thinking to change humans to computer, but unfortunately GOD will not give me the source code)
|
|
|
|
|
Check in the Visual Studio 2005\Projects directory for the solution directory. The solution file is probably sitting in there.
|
|
|
|
|
Hello!
I am reading data from sql server in a string. but no matter how kuch the data is in the sql server, i am only getting 4000 characters.
Is there some sort of limit involved in it?
Tried playing with SqlConnection.PacketSize, but invained!
Regards,
Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
Yes, the default varchar size is 4000.
Use the varchar(MAX) function to retrieve anything larger.
Daniel Minnaar
Lead Software Developer
|
|
|
|
|
or use the "text" - type ( make sure to read about the limitations / gains - but I guess if the text is more than 4000 characters this type is the way to go - you don't want an index on this field right ? )
|
|
|
|
|
Hello!
Is there any way to work with i.e. read and write data more than 8000 characters?
Regards,
Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
yes this is exactly what the text type is for (if you are using unicode take the ntext)
|
|
|
|
|
Hi, I want to disable a keypress handler of a mdi container form. I'm adding this on the container's Form_load:
this.KeyPress += new KeyPressEventHandler(Form1_KeyPressed);
and this on the child's VisibleChange event:
if (this.Visible)
{
principal.KeyPress -= new KeyPressEventHandler(principal.Form1_KeyPressed);
}
else
{
principal.KeyPress += new KeyPressEventHandler(principal.Form1_KeyPressed);
}
where principal is a property assigned on the child's load, in order to call the objects on the parent form:
principal = (FormMain)this.MdiParent;
When i run this the first time works. The handler works until I turn visible the child form for the first time (which tells me the -= is working), removing the parent's handler. After i visible=false the child, the handler gets added back, but now it calls 2 times the event attached instead of 1, and so on with every on/off of the child (3, 4, 5)...
why?
thanks a lot for your time.
daniel
|
|
|
|
|
Ok: the problem is with the if (this.Visible) , because this will be Form1 if the child is - well - a child of Form1 and you are handling the VisibleChanged event there.
Just replace this with child.Visible or (Control)sender (I am assuming you didn't change the event-param-names for the second one.
May I ask: why doing it this way?
Just put
if (child.Visible == true) return; to the From1_KeyPressed - handler.
|
|
|
|
|
wow, faster than i could edit it. I accidentaly posted it before finishing it out.
No, i'm not handling the visiblechange on form1 (parent), just on the child.
this.visible actually refers to the child.
i had to do it this way because the child form has a "searcher" textbox to a "SELECT blabla like" query on the textchange to a database.
|
|
|
|
|
Hi.
i'm not sure if you have to do it that way, but if i have to unsubscribe eventhandlers i use to keep them as member variables in my class:
public MyForm:Form
{
private KeyPressEventHandler myHandler;
public MyForm()
{
InitializeComponent();
myHandler = new KeyPressEventHandler(Form1_KeyPressed);
subscribe();
}
public void subscribe()
{
this.KeyPress += myHandler;
}
public void unsubscribe()
{
this.KeyPress -= myHandler;
}
private void Form1_KeyPressed(object sender, KeyPressEventArgs e)
{
}
}
and from your MDI Child form you do simply call now the subscribe() and unsubscribe() methods.
hope this helps
m@u
|
|
|
|
|
nope, didn't help, i keep getting the same problem....
i have to do it this way, if i try to go with the return way on the handler, the textbox that i want to work on doesn't get the typed text...
|
|
|
|
|
Hi,
I have the code following
private void btnSelectTable_Click(object sender, EventArgs e)
{
foreach(string str in listTables.SelectedItem)
{
listSelectedTables.Items.Add(str);
}
}
I have 2 checkedlists named "listTables","listSelectedTables"
I want to remove one item from "listTables" and place it in "listSlectedTables" ,when user clicks on the button "btnSelectTable".
Regards,
chanzeb chaudhary
|
|
|
|
|
I guess you've got a problem with something like
listTables.Items.Remove(str)
inside your foreach -block right?
Well that's because you are trying to change the collection your are enumerating ...
whenever I need something like this I use something like
<br />
Stack<string> toDel = new Stack<string>();<br />
foreach (string str in listTables.SelectedItem)<br />
{<br />
listSelectedTables.Items.Add(str);<br />
toDel.Push(str);<br />
}<br />
while (toDel.Count > 0)<br />
listTables.Items.Remove(toDel.Pop());<br />
</string></string>
|
|
|
|
|
"Error 1 foreach statement cannot operate on variables of type 'object' because 'object' does not contain a public definition for 'GetEnumerator'"
this is the error in the line where "foreach" is written....
I dont know what is the problem....
Regards,
chanzeb chaudhary
|
|
|
|
|
ah - sorry you are using ".SelectedItem" <- this will be just the one object you selected (that is a string),
try using ".SelectedItems" ![D'Oh! | :doh:](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_doh.gif)
|
|
|
|
|
Thanks Alot
Regards,
cganzeb chaudhary
|
|
|
|
|
Thanks Alot
Regards,
chanzeb chaudhary
|
|
|
|
|
How can I convert byte[] to string. Plsz help me soon
Thanks all.
Papais
|
|
|
|