|
I have created my a custom control which has a DataGrid in it.
I am creating a DataGridTextBoxColumn in the TableStyle as one of its columns.
Add binding with the datasource ..
I am unable to edit the columns in the datagrid displayed ...
How to make this column of datagrid editable...???
Thanx in advance
|
|
|
|
|
The Datagrid itself has a property called "ReadOnly". Try to set it to "false" manually.
This will make the fields in the DataGrid editable. Hope that's what you were talking about :P
|
|
|
|
|
|
Hi Folks.,
I have working with windows services. i want to access foxpro database from another database through services. actually .dbf is the database format for foxpro and this structure is normal file structure thats why i get confused .
If any one know abt this problem plz share with me.
regards,
ranandbe
|
|
|
|
|
Hello
Your post is quite unclear!!
ranandbe wrote: i want to access foxpro database from another database
What do you mean "Database from another database"??
ranandbe wrote: this structure is normal file structure
What structure?? What file?? dbf??
Well, if you want to connect to a Foxpro database -just like any other database- make an OLEDbConnection object with the proper conection string.
look in ConnectionStrings.com[^] for that.
Regards
|
|
|
|
|
Hi thank u for reply,
i have successfully connected the foxpro database through oledb in windows services. but i need the functionality to access the databse from the another one computer(by using services and the same foxpro database). Is this posible if u have a knowledge about this please share with me.
ranandbe
|
|
|
|
|
Hi every one,
I have an application that it is writen by VB.I have anothert application that it is writen by C# and is added to My VB project .I defined some global variables in vb and I'd like to use them in C#,how can I use them?
please guide me .
yours Sincerely,
Orchid
|
|
|
|
|
Hello
Answring your question this way maybe misleading. Some points must be clear first.
1- Does any of your projects compile to a dll?
2- You want to use these global variables at runtime or designtime? -May look obvious, but you must clarify this point-.
3- You said global variables. That means they don't belong o any class?? Why? Forgive my small experience in VB. More details on these global variables would be greatly appreciated.
Regards
|
|
|
|
|
Sooner than expected
For the global variables:
He probably is talking about the variables defined in the main class
(or the class where the main procedure is stored in...)
There are no global variables in the way you usually think of.
(Writing VB isn't different to writing C# except for the syntax and some common tasks which are done differently)
However, i would like to know what he means when talking about global variables too :P
|
|
|
|
|
Hello Mikone .
It's very nice to see you on the forum today.
I've heard that VB still has that global namespace or so where you can declare variables without being belonging to any class. From what you said it looks like it isn't there anymore!!
Extra Regards
|
|
|
|
|
I started googling around to check that and yeah, I am the one who is unexperienced. I started writing vb.net like one year ago and haven't heard of something like a global namespace yet but yes, it exists (Maybe i didn't know about because i try to avoid using global variables )
However, this is what i found:
"The namespace keyword is used to declare a scope. This namespace scope lets you organize code and gives you a way to create globally-unique types. Even if you do not explicitly declare one, a default namespace is created. This unnamed namespace, sometimes called the global namespace, is present in every file. Any identifier in the global namespace is available for use in a named namespace. Namespaces implicitly have public access and this is not modifiable."
As always, i wrote before thinking (yes, this is the wrong order ).
In germany we would call a person like me "Klugscheißer" but i haven't found the correct translation yet :P
That's it for now - sorry for spamming in the forums.
|
|
|
|
|
Hello
mikone wrote: i try to avoid using global variables
That's good. Using global variables is a very poor practice in a high level language. What you do is called Object oriented design as you already know, and it's good.
mikone wrote: i wrote before thinking
I told you missing something doesn't make you a bad programmer, and should not prevent or even lower your contribution rate. If you know something say it. If someone else disagree he/she should post his/her opinion. These are called discussion forums where we all discuss our points of views , and I still like many of you replies.
mikone wrote: sorry for spamming
You didn't, and please don't apologize. I told you earlier we all have our screw-ups -you didn't see mine luckily;P-, and what you do is calld helping not spamming. I'll be eager to read more of your replies.
BTW: Klugscheißer means smart chicken in english!!
Extra Regards
|
|
|
|
|
Dear Nader,
Thanks a lot for your reply,
I think ,I could not describe my question clearly.
In VB project I have a menu that it includs some submenus,I want when every one click on one of the submenue a variable for example "Myflag" in my project be on(for example be true or get a value )and during in VB project and C# project I want to read value of the MyFlag and do some thing with it.
I think this variable(MyFlag)should be global in VB project otherwise I can't use it in other part of VB project."do you agree with me?"
In reply to your question :
1-No ,they don't Compile to a dll.
2-I want to use global variable at runtime.
I like to hear from you.
yours sincerely
Orchid
|
|
|
|
|
Hello
Well, You are talking about inter process communications. This isn't easy, but not immpossible.
There are several ways:
1- Putting the flag in a shared file -doon't forget the locks;)-, accessed by both programs. Something like a config file or a database. Actually I don't like the idea.
2- Putting the flag in a registry key. Again, I don't like it!!
3- The above two solutions were easy. The next one is the best practice, but will need much more work.
Two process -under normal conditions- can't share the same memory block!! Yet, windows applications communicate with each other using messages. This will require:
1- Make P/Invoke calls to the windows API SendMessage() or PostMesage() functions.
2- Make a custom message or choose an exsisting message to carry the data.
3- Grab the handle of the other Form -one way or the other-.
4- Send the message with the possibility of sending an integer as a param.
5- In the receiving Form implement the IMessageFilter interface and catch your message in the PreFilterMessage(ref Message m) method.
If you want to share the same memory block, this will take h*#l more work. I hope you make it!
Regards
|
|
|
|
|
Thank you Dear Nader,
Do you have any sample code or address of link that I can use it ,I think it's better for me.
Best Regards.
Orchid
|
|
|
|
|
Hi,
You can also use .NET Remoting or IPC namespages.
Regards
|
|
|
|
|
Dear ejuanpp,
thanks a lot for your reply,
can you explain more about .Net remoting and IPC namespages because I don't know any about these subjects.
If there are any link about them please introduce me .
yours sincerely.
Orchid.
|
|
|
|
|
Hello
Actually it's IPC namespace. Look for code samples Here[^]
Regards
|
|
|
|
|
Hi,
Thing is that IPC namespace is really poorly documented in msdn. It looks, however, a lot like Remoting
I had to use it very recently, I will send you a few links soon.
Regards
|
|
|
|
|
How to open a dialog where I can browse the files
|
|
|
|
|
System.Windows.Forms.OpenFileDialog myofd = new System.Windows.Forms.OpenFileDialog();
myofd.ShowDialog();
|
|
|
|
|
Hello
Beside what Mikone has already said, I suggest the following if you want to implement file browsing in your Application:
1- You might want to take a look at FolderBrowseDialog class.
2- Populate a TreeView or a ListView with folders using methods provided in Directory class
3- If you want to implement Windows Explorer itself in your application, you can make a WebBrowser control, and set the URL to @"file:\\\C:\" to browse C: drive.
Regards
|
|
|
|
|
Hi All,
I am trying to develop a custom bitmap button, such that i want to make a part of the bitmap as transparent and the remaining part(Which is Non transparent) i want to set it as a button region.
Can anyone suggest me the approach to do that??
This is my first request..Hope i get a reply from someone.
Naveen
|
|
|
|
|
it will be done using gdi+
you can search for code in the above search box
|
|
|
|
|
Hi,
I am not sure whether I understood you correctly or not. You want to make a button which consists of a bitmap which has a transparent and (surprise surprise) a non-transparent area. Now you want that button to ignore the clicks which happen in the transparent area?
If so, you will have a lot of work. Afaik there is no built-in function to support such a feature. You probably have to start writing an own button-class, which inherits from system.windows.forms.control and make it act like you want it to...
So one possibility would be:
- Creating a new button class which inherits from control
- Creating handlers for the controls click events (they have to "judge" whether the click was on a non-transparent or transparent area)
- Using that Control in your projects.
That will be very difficulty but maybe there is an easier solution so just wait for a few more comments :P
Good luck,
mik
*edit* If you just want to make the button clickable (also will raise click event when the transparent area was clicked) you could take the "normal" button control and put the picture on it (picture property) - you could then turn off borders and stuff (just play around a bit with the properties). Doing so would result in the required button BUT it would also raise the click event if you click on the transparent area...
|
|
|
|