|
How in the world do I subscribe to the Selection changed event on the dynamic control. Somewhat new here...
Thanks,
Taen Karth
|
|
|
|
|
I don't use VB, I hate it. If you're using VB.NET, there has been some discussion on events on dynamic controls in the past day or so, search the forum for details.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
ok done some searching and still cannot find an answer... Would anyone else have any advice?
Thanks,
Taen Karth
|
|
|
|
|
ok you try doing in this way
create a handler which handles selection change event. when you have created the RTB assign handler you created to it by
using AddHandler
In SelectionChange handler use this code
If sender.SelectionFont.Bold = True Then
Me.CheckBox1.Checked = True
Else
Me.CheckBox1.Checked = False
End If
if you have selected a text which has a bold text then checkbox would be checked other wise not checked. (Keep a check box on
form)
----------------------------------------
Here's The code
'handles RTB's Selection Change Event
Private Sub RTB_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs)
If sender.SelectionFont.Bold = True Then
Me.CheckBox1.Checked = True
Else
Me.CheckBox1.Checked = False
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim txt As New RichTextBox 'Define A New RTB
txt.Size = New Size(100, 100)
txt.Location = New Point(0, 0)
Me.Controls.Add(txt) 'Add RTB To Form
AddHandler txt.SelectionChanged, AddressOf Me.RTB_SelectionChanged 'Assign SelctionChange Event Handler
End Sub
Pranjal Sharma
|
|
|
|
|
did I mention you are the man! hehe I completely forgot about AddHandler. Your code led me in the right direction. I extended it of course and put it in a module but it works great. Once again thanks for the heads up!
Thanks,
Taen Karth
|
|
|
|
|
please help me.
how do i apply colors on each row of my datagrid? im using ADO.
Thanks.
magnus
|
|
|
|
|
Hi all,
We are working on a windows vb.net project in which we need to add a listbox control to the datagridcolumnstyles. We know that we need to create an inherited class for this and Microsoft says we need to override certain methods but we can't find any literature on where to start and what methods need to be overwritten. Is there anyone who has experience in adding new datagridcolumnstyles and may be able to show us where we can start?
Thanks,
Trini.
|
|
|
|
|
I need help with figuring out how to have a toolbar that you can drag and drop. Any good help resources to refer to for this? Thank you!
|
|
|
|
|
So I have meself a simple little screen saver app that I made with a lot of help from articles here on codeproject and elsewhere (thanks goes out to all who post such articles and tutorials).
I would like to enable this app to create custom screen savers from settings the user specifies.
I need to figure out how I can have my application make a copy of itsself (or even another existing copy) with the user settings.
But doesn't it need to be compiled?
If someone could point me to a tutorial that might explain how to go about doing such a thing that would be great. Currently using VB .net 2003
-- modified at 14:04 Thursday 8th September, 2005
|
|
|
|
|
If I have understood you correctly:
You have a program that it is itself a screen saver, the user can chage the settings and you want to change the screen save using those settings.
(if this is your problem)
You do not need to create another copy of your program. You just need to save the settings and then load it at your program's startup. To do so, one easy way is to use the SaveSetting, LoadSetting functions.
If your problem is something else, please clarify it more.
|
|
|
|
|
Nope, nail on the head, er...
Another case of the developer making things difficult for themselves.
Thanks.
|
|
|
|
|
In a test I'm making I type this
oledbDataAdapter.SelectCommand.CommandText = "SELECT * FROM tbl_clientes;"<br />
oledbDataAdapter.Fill(Dataset)<br />
Me.DataGridBuscar.DataSource = Dataset
Then I change the code to
oledbDataAdapter.SelectCommand.CommandText = "SELECT * FROM tbl_clientes WHERE nombre LIKE '*j*';"<br />
oledbDataAdapter.Fill(Dataset)<br />
Me.DataGridBuscar.DataSource = Dataset
And nothing is selected!!!
If I copy and paste the SQL in the access editor, it returns a few records that begins with "j" (what I want!)
Why this not runs in VBNET?
Thanks.
|
|
|
|
|
Two things.
1) You say that you want to find records that "START" with J. Do not use a wild card in front of the letter else you will match records that have a j anywhere within the text.
2) Try using % character instead of * character as the wildcard indicator. I have had some luck doing this.
|
|
|
|
|
It works like you say... but why in access my query returns values and in VB not?
Thanks a lot!
|
|
|
|
|
Not sure of the real explanation, but it works. Access does not reconize % as a wildcard. But when passed a sql statement, it works.
Crazy Microsoft products......
-- modified at 14:32 Thursday 8th September, 2005
|
|
|
|
|
Yup, that happened to me too with the distinct command. Just make sure you check the syntax if it's compatible with the access.
|
|
|
|
|
Hi
I have a .net app in VB.Net that picks up some data via a web service and
then prints that data. In the process of printing that data I have to
validate it against a payroll program using a COM Interop link.
This works fine on my PC and on a colleague's.
However, on the client's machine I am getting the error:
Error Printing. Exception from HRESULT:Ox8004012D
I have been unable to find any reference to this error message. Can anyone
tell me what it means?
Many thanks
Roy Thompson
|
|
|
|
|
My guess is that the client's pc is missing something that your's and your colleague's pc has.
One way to find the issue would be to write to some sort of log file that would allow you to see what the program is doing and where in the program it's breaking.
|
|
|
|
|
I have a table in sql server with around 26 fields my problem is i don't know the best way to go about updating these 26 fields. I thought of creating a link from my existing datagrid to a webform and populating the form with the existing row's details and updating this way. If you have any better suggestions please help.
don't let the game play you, play the game
|
|
|
|
|
You want to save changes, or new values ? Either way, the best way is always to use a stored procedure, and call it. I would use a create/edit page that shows the details of one record, which can be selected from the datagrid.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I would like to create a linkedlist with a very very large amount of nodes.
Thus, I thought of using the swap file memory to avoid to crash my pc.
Anyone could give me some exemple to manage the swap in vb.net ?
Or give me some way to do this ?
Thanks
|
|
|
|
|
TheDarkMan wrote:
Anyone could give me some exemple to manage the swap in vb.net ?
You don't. The memory management system in Windows manages what parts of memory go to the swap file and what parts are in physical RAM - you do not have control of this.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
I would like to use the API VirtualAlloc,VirtualFree,...
No possible with those functions ?
|
|
|
|
|
This is completely uneccessary. You COULD do this, but these functions allocate UNMANAGED memory. You'll also have to write code to move your data back and forth between the managed and unmanaged world, slowing down your performance.
Believe me, what you are thinking of doing is not a good idea and a waste of time. I've used huge arrays of objects (2 Billion elements) before, using about 2GB of memory, without any problems.
Try it using normal methods before you start trying to code this. What you should be thinking about is how swapping to disk and back is going to affect your performance. This is something you'll have to deal with even if you do go through your VirtualAlloc method.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
In fact, i would like to this because i read articles on iocp completion port (almost all in c++) and i found this articles very interresting :
http://www.codeproject.com/useritems/IOCPNet.asp
And this person use a linkedlist with virtual memory to avoid
The WSAENOBUFS error problem.
explained at this article : http://www.codeproject.com/internet/IOCP_Server_client.asp"
But for my project i must only use vb.net (client spec). So i tried to rewrite the linkedlist and preallocator object of the first article but it's not easy.
Do you see my problem ? Maybe there are managed functions which will do the same things but i don't them ?
|
|
|
|