|
Hi Everyone
I have upper level framework that needs to be notified when the user has selected text in a regular textbox.
There doesn't seem to be a event to signals that the selected text value has changed.
Any suggestions other then a timer that polls the control?
Thanks
|
|
|
|
|
I think your right, there is no event for selected text, you would have to use key/mouse events or possibly on leave
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The quickest way to implement this would be with the MouseUp event. Try this approach:
private int selectedTextLength = 0;
private int selectionStart = 0;
private void textBox1_MouseUp(object sender, MouseEventArgs e)
{
if (selectionStart != textBox1.SelectionStart ||
selectedTextLength != textBox1.SelectionLength)
{
selectionStart = textBox1.SelectionStart;
selectedTextLength = textBox1.SelectionLength;
//notify framwork...
}
}
Cheers!
Richard Blythe
"Make it as simple as possible, but no simpler" Issac Newton
|
|
|
|
|
Hi,
When i assign a text to the datagrid cell that contains tabs "\t", the tab is ignored when the cell is out of focus or not in edit mode.
example:
myDataGridView[columnIndex, rowIndex].Value = "My\tText";
when the cell is out of focus or not currently edited, the displayed text is : "MyText".
when the cell is entered to edit text, the displayed text is : "My Text".
How do i force the cell to always show the text with the tabs, even in read only mode?
Thanks.
|
|
|
|
|
Sounds like a bug to me, it begs the question why you are using tab (oh yeah text colums in a grid!) instead of spaces.
Options
Manage the scroll events to reformat the cell when it enters the view range (horrible)
Use a mono spaced fon and spaces to simulate the cols!
Oh yeah and report the possible bug.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I paint some of my rows a background colour.
When the contents are written back over the background, any wordwrap settings are lost, and as much text as possible is crammed into the cell. This means that if the row height is not small enough, more than one line of text can bee seen.
It seems that StringFormat.Trimming is ignored - none of the settings have any effect.
Which means that I am forced to use very thin rows, and there is no way you can have an ellipses displayed in the cell to show that there is more.
Anybody have a better soluton?
Nigel
|
|
|
|
|
There are some fields in the datagridview that are required data and some are not. My question is, how can I prevent the user from leaving the row until they have filled the appropriate cells or canceled the pending row. If they are entering data in a required cell, I can work with that but if they are in a non-required field, I have no idea. By the way, I can't get the row to cancel with the Escape button if a cell has been typed in. Any ideas?
"Make it as simple as possible, but no simpler" Issac Newton
|
|
|
|
|
I NEVER allow data entry into a grid - always force the user to a dialog where you have greater control of the one (1) record you are working with. The one exception to this is checkboxes only.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I have a complex form in a C# project.
I want to use a copy of this form in a vb.net project.
What is best practice?
Kind regards,
John Slaats
|
|
|
|
|
If you want just the controls to be copied then you can have both projects open in Visual Studio. Then copy the controls from the designer and paste them into the desired languages' designer. Keep in mind that their are conversion programs that can convert entire programs from VB<->C#.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
You should be able to just call the C# from from VB.NET. Not much to it, put the C# form in a class, compile it and reference it in the VB code.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Dear Friend ,
I have some problem to handle WebBrowser control in my Visual Studio 2005 windows application using C# language, actually i create an apllication which show important details about an control use in web site like if i pass url of http://www.google.com in WebBrowser Control it will open that site in that control and with some logic i show the important control list present in that web form with there imp property which will easy for us in testing web site controls and there properties for our sites...
all working fine...
But when i use an site for test which is after login (from that WebBrowser control) try to open in new Fullscreen form, because of which i think it lost the thread and give me login fail error as well as it will open in new form because of which i can't access the forms control using mshtml dll (which will usefull for accessing html controls and there properties) and WebBrowser control.
I dont know what to do for this, is it threading problem???
Or is it possible to open that new window in the same WebBrowser control with same thread with some logic, so that i can access the properties of that control???
Please give me an idea i m bang my head lots of time on my desk (I know this is not an a good idea..), Please Help Me....
thanks in advanced
Sasmi
|
|
|
|
|
hi all,
I want to set up my windows application project.
I know creating normal setup file. But
I want to know how to create a setup file which will ask to enter password or key at the time of installation to complete the setup (the password which is already preset).
for eg. when we install MS Office it asks us to enter product key in the same way
plz help me by giving the procedure.
thanks in advance..
|
|
|
|
|
I think you can use custom actions
I Wish the Life Had CTRL-Z
Wizards First Rule : People are fool,they believe what they want to believe or what they afraid to believe
www.subaitech.blogspot.com
|
|
|
|
|
Greetings,
Does anyone knows how to invoke (programatically) the different dialog boxes that VS has, for example the CellStyle Builder Box or the Add Columns dbox, Edit Columns dbox for the DataGridView, The Items Collection Editor for the Menus?
I know I can use EditorAttribute for properties, but the problem comes when dealing with the DataGridView and its columns, i'm using a PropertyGrid to modify the DGridV at run time but the columns do not appear.
I have this code:
public partial class UserControl1 : DataGridView
{
.....
public new DataGridViewColumnCollection Columns
{
get
{
return base.Columns;
}
}
public DataGridViewColumnCollection MyColumns
{
get
{
return base.Columns;
}
}
......
}
The funny/strange thing is that Columns doesn't show the Editor but MyColumns does show it.
I have done a search for DataGridViewColumnCollectionEditor but i just can't find it. Are these dialog boxes available somehow for developers?
Any hint or orientation is well appreciated.
Thanks
modified on Friday, June 27, 2008 10:06 AM
|
|
|
|
|
Well after doing more and more research i found that the EditorAttribute is making the difference between both properties, so in order to override it i had to do something like this:
[Editor("", typeof(UITypeEditor))]
public new DataGridViewColumnCollection Columns
{
get
{
return base.Columns;
}
}
But this still does not answer my original question...
Is there a way to use the editor from the code? I guess not...
Any hint or orientation is well appreciated.
|
|
|
|
|
Fairly new programmer, please excuse me if this is kinda newbie but I couldn't find an answer by searching. I have a windows form, and I was messing around with its properties. Now when I run it, all the white backgrounds are now transparent(you can move icons on the desktop through them). I need help figuring out how to make them function like default again. Thank you in advance for any help
|
|
|
|
|
In design mode, click on your form to select it. In the properies window for the form find the Transparency Key property and set it back to transparent. You must have set it to white instead.
|
|
|
|
|
Hi,
I'm curious what control(s) you use when you have a simple data input tasking involving rows and columns when :
1. you are not concerned with data-binding
2. you don't want to use a datagrid
3. you don't want to use a listview and muck about with non-editable run-time sub-items.
In other words you want a bunch of organized input fields, but want a very light-weight implementation. And you do want to use some control or combination of controls; i.e., you do not want to "hand-roll" a custom solution with a fixed number of textboxes in a panel or some such.
thanks, Bill
"The greater the social and cultural distances between people, the more magical the light that can spring from their contact." Milan Kundera in Testaments Trahis
|
|
|
|
|
Hi there,
i have a problem with creating Custom dataGridViewCell
i want to bind the column with an object and in the cell display obj.Description.
the editing control is a userControl that contains a textBox to Display the description of the object and keep the object in tag of the textBox for calculations, and listBox for suggested values (brothers object of the object in the textbox tag).
the problem is with formatting the cell, an exception accoured says could not convert from string to clsClass (type of my object).
plz help
|
|
|
|
|
I got a winform which is displayed in browser...the a.exe file has a config file which has a key to choose between production and dev databases. I created the iexplore.exe.config file with the required config file keys and kept in the root folder(c:/inetpub/wwwroot/)...when i run the a.exe file in browser its not reading the iexplore.exe.config file at all ....could any 1 please help me...
a.exe (.net2.0 app) working in IE6 in win 2003 server
Thanks in advance.....
|
|
|
|
|
Looks like you did spam the site, yes.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
you have post same question 4 times on 4 different forum.
|
|
|
|
|
Can we use the directshow methods in VC++ windows forms application. I have worked in VC++ MFC using Dshow methods and dont know how to use in VC++ Windows forms application. I got linker error when I use the Dshow methods, also I specified all the libraries in Project properties. Please advice.
|
|
|
|
|
bhanu_8509 wrote: Can we use the directshow methods in VC++ windows forms application.
I am not up to date with the variations of Direct<whatever> but most of it is available to the .NET platform[^]. I imagine there are plenty of articles and tutorials for it.
Also for managed C++ development questions there is a forum titled Managed C++/CLI
led mike
|
|
|
|