|
Thanks A lot Paul..You Solve My Problem
Thanks and Regard
TCim
|
|
|
|
|
Hi,
May i know how to be able to select any shapes drawn by clicking at the border of the particular shape? If there are more than one shapes displayed, how do i select one of them using a mouse event? which command i need to use? Any suggestions?
thanks
|
|
|
|
|
There are no "commands" to do this. You'll have to program this behavior yourself. See this[^] implementation of a drawing canvas that may help you get srtarted. Also see this[^] implementation of a rect tracker.
/ravi
|
|
|
|
|
Hi,
I want to create a form that has 2 areas. One area is where all the pre-drawn shape is located and the other area allows the shapes to be drag and drop onto it.
should i use custom control for the area that allows the shape to drag and drop onto it? How about the other area?
how to ensure that the pre-drawn shape is able to be seen all the time and any one of the shape is able to be selected, drag and drop to the other area?
Any tips what i should do and what kind of classes that i should use?
Thanks
|
|
|
|
|
|
|
Hi,
in C# (and C and C++ and Java) you cannot have just a backslash in a string literal.
Each occurence of \ will consume the next character and replace them both by one
character; examples \n stands for newline, \t for horizontal tab, ...
and finally \\ stands for backslash
So if you want to write a path literal, it would look like "C:\\temp\\file.txt"
where each \\ represents one backslash.
You can turn off all the above, by prefixing a @ sign like so: @"C:\temp\file.txt"
When a variable is holding a string, it holds the actual characters, not the above
conventions (that apply to string literals only). Hence the command line you obtained
will not contain \\ and is perfect for file I/O operations as is.
Hence your statement "C# needs path with \\" is wrong, it is string literal that
wants this (unless @), but not string variables.
|
|
|
|
|
its a string thats working
string abc = "C:\\Documents and Settings\\user\\Desktop\\project\\bin\\Debug\\project.exe %1";
this isnt working
string[] args = Environment.GetCommandLineArgs();
string cm = @args[0] + " %1";
now, any other way or solution...
Becoming Programmer...
|
|
|
|
|
Hi,
"isnt working" is a bad description; if compilation fails, the compiler gives an error
message and a line number, so you should report the exact error message and indicate the
precise line where it happens; this will yield the best reply on these forums !
xmen_xwk wrote: @args[0]
is wrong: @ only acceptable in front of string literal, not in front of string variable.
And what is it you plan to do with cm ?
%1 would not work for Process.Start()
it would work for file extension definition in Registry
I am sure you should not already be manipulating the registry programmatically,
when you still are a beginner in C#, or so it seems...
|
|
|
|
|
Luc Pattyn wrote: "isnt working" is a bad description; if compilation fails, the compiler gives an error
message and a line number, so you should report the exact error message and indicate the
precise line where it happens; this will yield the best reply on these forums !
yeah, as i said "it isnt working" that means not working, it never give any error
Luc Pattyn wrote: And what is it you plan to do with cm ?
i m associating the files,
i have to set my application path in registry thats why i m doing this
the first code is working
and the second isnt working
im saying isnt working because when i click on button that have the first code(its setting the registry), the file directly opens(when click on file) but when i use second then the file doesnt open
i hope you understand....
thanks
Luc Pattyn wrote: I am sure you should not already be manipulating the registry programmatically,
when you still are a beginner in C#, or so it seems...
yep, its first time
Becoming Programmer...
|
|
|
|
|
Does System.Windows.Forms.Application.ExecutablePath() work any better?
What do you get in cm?
What do you do with cm?
|
|
|
|
|
PIEBALDconsult wrote: Does System.Windows.Forms.Application.ExecutablePath() work any better?
cm and this are same but cm have " %1"
the cm is that what i need but just difference is, it have "\" instead of "\\"
cm = "C:\Documents and Settings\user\Desktop\project\bin\Debug\project.exe %1";
i need
"C:\\Documents and Settings\\user\\Desktop\\project\\bin\\Debug\\project.exe %1";
Becoming Programmer...
|
|
|
|
|
string newStr = oldStr.Replace ("\\", "\\\\");
/ravi
|
|
|
|
|
This may be a dumb question (total .NET newbie here), but how do I allow the user to edit an item in a checkedListBox control?
With a treeView control I call treeView.SelectedNode.BeginEdit() but I can't see an equivalent method for checkListBoxes. Am I missing something really obvious? Thanks!
music: www.bradsucks.net
|
|
|
|
|
As far as I know, it is not possible. You would need to implement that functionality yourself. You could try creating a textbox and positioning it over the item you want to edit. I've seen it done before, just not in C#.
|
|
|
|
|
Hello
The .NET ListView control has a useful function (actually two) BeginUpdate and EndUpdate.
These functions allow you to stop repainting of the ListView before you edit the items in the list and then resume repainting. This prevents flickering when a lot of items are added.
I'm wondering if there is a (easy) way to do this with other controls.
In my case that would be a FlowLayoutPanel, and i'm trying to prevent it from repainting while i edit the size of a few controls inside of it.
Is there a way to do this, without creating a UserControl from scratch?
Thank you.
|
|
|
|
|
Yep! Take a look at SuspendLayout and ResumeLayout . I think they're what you are looking for.
[EDIT: Actually they are Control members, so they work for every Control -derived class]
|
|
|
|
|
Thank you very much, i will try it ASAP!
|
|
|
|
|
Hi,
Is it possible to link a javascript file to a WebBrowser control's document? For example, if I have a library, whose main js driver file is called myLib.js, is it possible to link to the library from a document loaded in the WebBrowser control?
I have tried something like:
<br />
webBrowser.DocumentText = "<html><head>" +<br />
"<script language=\"JavaScript\" src=\"myLib.js\"></script>" +<br />
"</head><body>" +<br />
"<button onclick=\"testFunc('running test func')\">Call test func</button>" +<br />
"</body></html>";<br />
where testFunc(...) is a function in my javascript library, but it does not work.
Thanks in advance,
-----------------
Picazo
|
|
|
|
|
I have a app connecting to sqlserver using the ntlogin.
I want to verify if the NT user has access to read/read-write to the database/catalog.
This is in a corporate environement, so the sqlserver access must be setup via an Active Directory GPOs.
Anybody know how to do this?
Luke
|
|
|
|
|
What about just trying to do it? If you get an exception (either on opening the connection, doing the update), then you know you can't do it.
|
|
|
|
|
I was thinking of that, but i want to allow/disallow certain functions if the user has read vs. read/write access. I will disable all buttons except the search button if the user has read only rights.
|
|
|
|
|
I am not too sure about this, but depending on the user permissions I think SELECTs can work and UPDATEs can fail.
1. Try to connect to the database. If successful, user can login
2. Try to read a record (with SELECT). If successful, user has read access
3. Try to insert or update a record. If successful, user has write access
If only the third test fails, the user has read-only access.
|
|
|
|
|
Unfortunately i can't push an insert or update to production databases in order to determine if the user has write access, so that brings me back to needing to query some sort of users table in sql plus. Do you know where that might be?
|
|
|
|
|
Hi everyone,
The original idea of the new library(MRCopy) that I want to create is to offer the possibility of saving state of the client application. How do it? Using the memento pattern and reflection and serialization...
It’s a simple idea that need to be worked but I think that it goes forward is something helpfully for any Windows or web application.
Any help or suggestion will be welcome.
Thanks in advance
|
|
|
|