|
Hi,
How to disable/remove "Delete-Key" on dataGridview?
Thank you
(Riaz)
|
|
|
|
|
You could override PreProcessMessage method
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData.Equals(Keys.Delete))
{
// return true to tell the caller,
// that the message was processed by this control.
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
}
or simply set AllowUserToDeleteRows to false
|
|
|
|
|
How can i create office 2007 rtf control?
Office 2003 rtf and normal rtf can't support some unicode system.
Zippy Pack
|
|
|
|
|
Actually I am using an image when the mouse is over on the image i want to increase the size of image,like zoom effect, and it increase the original size of the Image control and it will half appear outside of my form.
|
|
|
|
|
No you can't. The form which is the container of your control is like a piece of paper. Your picture can only be drawn within the boundary that your canvas allows. You could end up scribbling on the desk, but GDI+ doesn't like that
Daniel Minnaar
Lead Software Developer
|
|
|
|
|
I have 2 projects coming up that require me to use existing map/floorlayout, certain areas must them be identified by the user. Lets say Room1, Room2, etc. Those areas should then be saved and either allow the user to select them (identifying which area was selected) and colour (fill) them in order to show "occupied" for example. (It will be done in WinForms .NET 2.0)
Honestly have never done something like this and was wondering what tips and pointers my fellow CPians could give me
Francois
modified on Tuesday, December 04, 2007 1:37:55 AM
|
|
|
|
|
Do one thing
Create Two variables for 1) for room no 2) for color
Now the user prompt the user to select the room and color
that work you can access by four button or chick box
When the user select the check boxes now you should generate an event which will take the color and room no as argument that you will handle through the coding the custom color and room.
|
|
|
|
|
Sorry maybe I was not clear enough
These rooms must be visualy defined. For example the client will scan in a floor layout of a building. Then by "drawing" on this scanned image define where "Room1", "Room2" etc are in terms of location and size.
Then a user must be able to click on a area and the application must then identify the click; i.e. whether the user clicked in "Room1" or "Room2" on the image. Also it needs to display the image with (for example) "occupied rooms" being shaded, indicating they are unavailable.
Hope that helps...? We are talking about images and GIS kinda stuff here ... I think
|
|
|
|
|
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!
|
|
|
|
|
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
|
|
|
|