|
Thanks for your reply again. In my situation I have to transfer the data out from SQL server,but the users in my office don't understand the SQL syntax.They only want to deal with excel file.So I have to write a program to faciliate thier work and export the data to excel.However, thanks for your replay and it really helps me lots.
Sincerely,
JIm
|
|
|
|
|
Hi,
I need to highlight the ListViewItem during dragOver operation. Since C# does not seem to be support this feature, I am acheiving the same by changing the BackColor and ForeColor as follows:
if (highlight){
listViewItem.SubItems[0].BackColor = Color.Navy;
listViewItem.SubItems[0].ForeColor = Color.White;
}
else {
listViewItem.SubItems[0].BackColor = Color.White;
listViewItem.SubItems[0].ForeColor = Color.Black;
}
This causes the entire listView to refresh making it look very ugly. I tried to control the refresh by invalidating only the listViewItem as follows.
listView.Invalidate(listViewItem.GetBounds(ItemBoundsPortion.Label));
But this too did not help. Also, the listViewItem is getting higlighted more than the Text area. It seems to be higlighting the Column's width.
Any thoughts on how I can acheive the highlighting in a better fashion?
Thanks.
Kiran
|
|
|
|
|
Kiran Kamath wrote:
Any thoughts on how I can acheive the highlighting in a better fashion?
Just select it. You would already have the ListViewItem so set its Selected property to true . After it's dropped, you can set that property to false .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I did not want to highlight by selecting the item, as on "Selection" I perform host of other actions. But I guess this is the only way to avoid the flickering of the ListView. Thanks for the reply.
Regards,
Kiran
|
|
|
|
|
I am using a remoting program in which i have a server and a client. I want the client's computer name and ip at the server. How can i get it in c# .net 2003.
Please explain...
Rahul
|
|
|
|
|
Environment.UserName to get the user name of the client, you could get the IP address of the client using something like System.Net.Dns.GetHostByName(Dns.GetHostName()).AddressList[0]
#include "witty_sig.h"
|
|
|
|
|
The simplest way would be to have the clinet send it own Machine Name and IP address(es). Or the client could send its own Machine Name and the server works out the list of addresses for the client using System.Net.Dns.GetHostByName(clientMachineName) .
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Do you know how can I make DefaultButton in C# as in MFC?
Thankx
Wizard_01
|
|
|
|
|
Simply juust set the AcceptButton propoert of your form to your button name.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
Hi Judah
Thanks for the reply.
I can do all of that, that is not a problem.
The problem arises when multiple fonts are selected such as..
Font one font two font three
and all of this is selected.
There is no font object for the selection in that case so it is impossible to modify the bold (or other attribute) property without changing the selection to a common font.
If you go into word for example, you can type in multiple words in multiple fonts.
Then when you select the multiple words, the font dropdown goes blank (as it should).
You can still click on the bold button and all your selection will change to bold (or from bold) without modifying the fonts of the selected words.
|
|
|
|
|
Ah I see your problem then. I'll bet you can P/Invoke this one somehow - ask Heath, he should be able to help you better than I can.
Otherwise, yeah you could go character by character through the selected text, find the different fonts, and set the bold property on each, but that would be a big pain the ass to do. Sorry I can't help you more.
#include "witty_sig.h"
|
|
|
|
|
Hi Judah
Judah Himango wrote:
I'll bet you can P/Invoke this one somehow
Hadnt thought of this.
Was thinking of subclassing the RichTextBox and adding the props back in using regex as a back end.
Judah Himango wrote:
Sorry I can't help you more.
Thats fine, thanks for trying
Cheers
JB
|
|
|
|
|
now,i want to contorl the checkbox of the application(c#),
in vc++ ,i send the message to BM_SETCHECK message to the c# application,
but the C# application is not respond the message BM_SETCHECK,
so that ,how can i get it?
Thanks!
just do it!
|
|
|
|
|
How do you check the meaage? See Application.AddMessageFilter() method in MSDN and use the technique in it for controling the message. I think that should be work but not sure.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
thanks Mazdak.
i want to control the check box of a c# application,
by that way ,send a message from C++ to C#.
if i send BM_SETCHECK message from MFC to MFC,it's right,
but from MFC to C#,it's wrong,
why?
just do it!
|
|
|
|
|
I think thats because C# handle then automaticlly and if you want to access them you should do the thing that I told you in my first reply.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
thanks Mazdak,
but i have no source code of the C# application,hehe.
it's really a question.
just do it!
|
|
|
|
|
How can we add Arrow Head instead of '+' or ' - ' signs before nodes of the TreeView Conrtol, such that when we expand it, instead of '-' sign it should show an arrow head in downward direction and in compressed state instead of '+' sign it should show an arrow head pointing towords left.
Please guide.
regards
|
|
|
|
|
How to Link 2 to 3 WebForms?
How to Call WebForm using DropDownList?
How to Enable/Disable RadioButtonList in a certain senario:
1. You are in a current WebForm (Set As Start Page) default.
2. A certain RadioButtonList with (yes/no) choices will enable/disable a certain RadioButtonList in another WebForm that is part of the project.
Thank you in advance to those willing to help!!!
God Bless and More Power to this site!!!
Chaoi!!!
HappyKim
|
|
|
|
|
hi,
Ur Q : How to Call WebForm using DropDownList?
Ans : If I have understood your query... then the answer is you need to handle "SelectedIndexChanged" event of the DropDownList.
From the "sender" parameter you can get the selected Item. Based on the item selected you can redirect the page to a different web form using "Response.Redirect()" method.
ur Q : How to Enable/Disable RadioButtonList in a certain senario:
1. You are in a current WebForm (Set As Start Page) default.
2. A certain RadioButtonList with (yes/no) choices will enable/disable a certain RadioButtonList in another WebForm that is part of the project.
Ans : Well, this Q is bit unclear... r u planning to show the second page on the change of the radio button or r u planning to first select the radio button and then click a button say "Next" button to go to the next page??...
Anyways... let me give you the hint of handling the senario... If you are planning to handle the Radio button click event... then you need to handle "SelectedIndexChanged" of RadioButtonList.
On click you need to identify which radio button is clicked and either you append the value to the querystring or store it in a Session variable. And then redirect to the next page using "Response.Redirect()" method.
In the Page_Load of the next page extract the value from querystring or Session variable and then with a simple if or switch enable or disable whatever control you want to using itz "Enabled" property...
eg : RadioButton1.Enabled = false;
Hope this solves your problem...
regards,
Aryadip.
Cheers !! and have a Funky day !!
|
|
|
|
|
Good Day!!
Thank you for the time and sincere concern to answer my question. But as a beginner and with a specific method of understanding a specific new idea "I am a learner that show me and I will understand it far more better." If it is just ok with you, could I ask for an example? I coding perhaps.
Please give me example:
1.How to Call WebForm using DropDownList.
2.How to Enable/Disable RadioButtonList in a certain senario.
(More Details)
2.1.You are in a current WebForm (Set As Start Page) default
2.2.A certain RadioButtonList with (yes/no) choices will enable/disable a certain RadioButtonList in another WebForm that is part of the project.
2.3.Select the RadioButtonList First then click the DropDownList to go to the next page.
2.4.And when the 2nd WebForm is been Loaded some RadioButtonList is enable, some Disable. The Enable RadioButtonList is been enable because on the 1st WebForm RadioButtonList enable it.
Hope I link the connection between the First Question to the Second Question. Thank you very much and God Bless to your Career!!!
|
|
|
|
|
In order to get this working you need to set the FLatStyle property to System. But if the button is displaying an image then doing this removes the image, it seems you can only have XP visual styles with buttons showing just text? Is there a way to get the xp style and show an image on the button?
|
|
|
|
|
Yes, there's an article regarding this here on codeproject. please search.
#include "witty_sig.h"
|
|
|
|
|
Hi All
Does anyone have any good references for regex in .NET.
Online, pdf, or hard copy.
Cheers
JB
Not Bitter, Just Twisted
|
|
|
|
|
hi,
You may try out this site...
It was a good collection of regular expressions... itz a library kinda stuff... I have found it very helpful...
Regular Expression Library
regards,
Aryadip.
Cheers !! and have a Funky day !!
|
|
|
|