|
Hello There
Can any one give me a reference for any tutorial or help on using OwnerDraw.. I have to build couple of custom controls and need to understand the basics and usage of Owner Draw...
like List View Control with Headers having color say blue...
like back color for Menu... I found couple of custom Menu Controls but need to understand it properly which I could not.
like Scrollbar color and Style for Panel Control etc...
thanks for support
|
|
|
|
|
Hi,
I have 2 TextBoxes on my windows form free from panels..
I want to jump from first textBox to second when i hit a special character in my keyboard( like comma).
I want to write this to 2 textBoxes( 123.456,789)
(123.456) to first textBox and (789) to second textBox without hit to TAB, just by comma .
Thanx in advance..
-MCP& MCAD &junior coder--
|
|
|
|
|
Use the Keypress event of your first textbox to get the key that the user is typing. Set keypressEventArgument.Handled to true if key typed is a comma and then set focus to next textbox.
|
|
|
|
|
Here is my code that u talk about:
----------------------------------
1- Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As
2-System.Windows.Forms.KeyPressEventArgs)Handles TextBox1.KeyPress
3- If Not InStr("0123456789," + Chr(8) , e.KeyChar) > 0 Then
4- e.Handled = True
5- End If
6- If e.KeyChar = "," Then
7- e.Handled = True
8-?????? 'I dont know how to focus cursor to 'TexBox2.SelecetionStart=0
10- End If
11- End Sub
Plz, would someone give me the code of line 8 at upperside..
Thanx in advance..
-MCP& MCAD &junior coder--
|
|
|
|
|
textbox2.Select(0, 0) 'To locate cursor at the begining
textbox2.SelectAll() 'To Select all the content of the textbox
textbox2.Focus()
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Try this.
Private Sub Text1_Change()
Dim lCount As Long
lCount = Len(Text1.Text)
For lCount = 1 To lCount
If Mid$(Text1.Text, lCount, 1) = "," Then
Text1.Text = Left$(Text1, (lCount - 1))
Text2.SetFocus
Exit For
End If
Next lCount
End Sub
George
|
|
|
|
|
if me.TextBox1.Tex="." Then
me.TextBox2.Focus()
End If
I hope this helps to you
|
|
|
|
|
hi,
We are doing a project on Live video conferencing in LAN.File is recoreded on a single PC but the actual thing must do is to send the data on a network.I m using directshow for this in which "IMediaControl Interface" is used for run and stop the file to record.But i need the actual data(streams).The question is:
1.How to get Audio & Video Stream data using Directshow?
2.How to send,replay this data on network?
plz reply me soon.
best regards
shumyla
|
|
|
|
|
i want to enable a textbox by clicking on a radiobutton. i mean that when i check a radiobutton1 then a textbox called textbox1 should get enabled how do i do that.
|
|
|
|
|
myTextBx.Enabled = true
where myTextBx is your textbox control
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
well this is my code: -
Private Sub Radiobutton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Radiobutton1.CheckedChanged
If Radiobutton1.Checked = True Then
TextBox6.Enabled = True
Else
TextBox6.Enabled = False
End If
End Sub
but it is not working. no errors but not working.
|
|
|
|
|
well this is my code: -
Private Sub Radiobutton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Radiobutton1.CheckedChanged
If Radiobutton1.Checked = True Then
TextBox6.Enabled = True
Else
TextBox6.Enabled = False
End If
End Sub
but it is not working. no errors but not working.
|
|
|
|
|
set a breakpoint into the function and watch if the function is called...
and watch also if it is going into the right case (maybe Radiobutton1.Checked is not set to what you think...)
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
i'm still not able to figure out what exactly is the fault. or where things are goin wrong. is there any other way to make a textbox active other than using radiobuttons and buttons.
|
|
|
|
|
hum, no, there no other way.
but i thought to something : isn't your textbox into a groupbox that is itself disabled (Enabled = false) ??
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
no it's directly on the webform.
|
|
|
|
|
try this.
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton14.CheckedChanged
Dim rdoTemp As RadioButton = CType(sender, RadioButton)
TextBox1.Enabled = rdoTemp.Checked
End Sub
|
|
|
|
|
|
What exactly are you trying to achieve - all the code submitted in this thread works, so I suspect that you may be doing something out of the ordinary. Is a radio button the right control for you remembering that they are grouped.
Perhaps a little more explanation of the task at hand may help in providing a solution that works for you.
|
|
|
|
|
ok i'll tell you what exactly i'm trying to do. i have a dropdownlist which has a collection of various items. the user has to select anyone from it. in case the user does not find his category of items in the dropdown list then he has to click on the radiobutton which has its text as 'NOT AVAILABLE' which in turn enables the textbox and the user can type in his special category of item. and all these controls are directly on the webform.
|
|
|
|
|
Ok. Firstly, apologies,' I didn't realize that this was web based. I am not a web person myself, but the following should work. I am sure some 'true' web people out there will come up with a more elegant solution for you.
Firstly, radiobuttons do NOT cause a post back to the server by default, so you must enable this (AutoPostBack property to true)
Then, you can key this code into your page_load event.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
<br />
If Not IsPostBack Then<br />
'<br />
' normal code to initialise the form<br />
'<br />
Else<br />
TextBox1.Enabled = RadioButton1.Checked<br />
End If<br />
<br />
End Sub
I am sure that you should be able to achieve the same results via some form of client side script, but as I said - I am not a web person, and the above code worked for me when I tested it !!
|
|
|
|
|
no need for apologies raph. it happens after all we are there to help each other. anyways thanx for urs time for my problem and ur involvement. i also found another way of doin it just some logical if else loops helped remove the loop holes.
|
|
|
|
|
If RadioButton1.Checked=true Then
me.TextBox1.Enabled=true
Else
me.TextBox1.Enabled=false
EndIf
I hope this helps to you
|
|
|
|
|
Can i set a template collumn in (Windows Form) DataGrid as in (Web Form) DataGrid.
Thanks in advance
|
|
|
|
|
Not exactly. First you need to create a class based on the DataGridColumnStyle if you want to implement custom appearance or functionality for your columns. You would then create a new DataGridTableStyle and add your new class to its GridColumnStyles collection. Then you add your DataGridTableStyle to the TableStyles collection of the DataGrid.
There are plenty of articles on doing just that. Search for "DataGridColumnStyle" here on The Code Project and you will find plenty of help.
VS.NET 2005 brings a lot of new features to the DataGrid that should make life a lot easier than this.
|
|
|
|