|
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.
|
|
|
|
|
I have a .exe file developed using windows aplication in vb.net. i want to run it in web application developed in vb.net. The .exe must run once i click on link on the page developed in using web application in vb.net
|
|
|
|
|
Well, you can hyperlink to the file, then people will get prompted to download and/or run it. They need to download it before it can be run, and a web app can't run an exe on the client. Your web app code runs on the server, all the client gets is HTML and jscript.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
How to develop openfiledialog box in web application, so that we can select a file from the system on which the application is running
|
|
|
|
|
HTML includes one, and that's basically your own option. I forget what it's called, but it is a text box with a ... button next to it, for browsing and selecting a file path.
I believe it's an input, type = file. As in:
<input type="file" (etc/etc/etc)
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Can someone please tell me how I can get VS.net to recognise Crystal Reports 8 ?
Thank you very much
|
|
|
|
|
Hi,
Not sure if this is the right board for VB6 questions, if not sorry.
I'm trying to use the Hyperlinks collection class Add method to add a hyperlink to a Word document. I can get the Add method to work for 1 hyperlink fine. As soon as I call the Add method a second time, the first hyperlink turns into text and only the second hyperlink is indeed a hyperlink. I checked by Debug.Print the value of ActiveDocument.Hyperlinks.Count which stays at 1.
Is there a known problem with the Hyperlinks collection class in VB6.0.
BTW, I am using Office 10.1.6 and Word 10.1.6 and VB6.0 on a Mac OSX 10.2.8
The snippit of VB6 code adding the hyperlink is:
<br />
...<br />
Dim R1 As Range, TheURL As String<br />
...<br />
<br />
LinkLabel = "Link" & BMi<br />
T.Cell(3, 1).Range.Text = LinkLabel<br />
T.Cell(3, 1).Range.Select<br />
Set R1 = Selection.Range<br />
ActiveDocument.Hyperlinks.Add Anchor:=R1, Address:=TheURL, _<br />
ScreenTip:="Link: " & TheURL<br />
TextToDisplay:="Link" & BMi
where BMi is an Integer and defined earlier in the code. T is a Table.
Any ideas would be greatly appreciated.
Ed
|
|
|
|
|
Answer to my own query:
First, to add a hyperlink to a cell in an existing table, make sure to omit the end-of-cell marker in defining the range for the Anchor.
The following works in a stable, predicitable manner:
<br />
Set R1 = ActiveDocument.Range(Start:=T.Cell(3,1).Range.Start, _<br />
End:=T.Cell(3,1).Range.End - 1)<br />
R1.Select<br />
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:=TheURL, _<br />
ScreenTip:="Link: " & TheURL, TextToDisplay:="Link" & BMi<br />
where R1 is a Range and TheURL is a string containing the URL to be made a hyperlink in a Word document.
The example is to add a hyperlink to row #3, col. #1 of an existing table. This is easily generalized to any i,j cell in a table.
Ed
|
|
|
|
|
Hi
Does anyone have a solution or maybe someone could point me in to the
right direction.
I would like to code a game config editor so I dont have to
edit configuration files manually.
The problem to solve is how my code makes my app find
a string like 'Playername' and then let me edit the playername.
It would be easy to code this if string Playername always would be
on the same row. But it will not always be on the same row.
Example
Playername = MyName
I want my app to find 'Playername' and then edit MyName.
BTW! My applicaiton lets me edit MyName in a textbox.
Should I use string Compare or Equals?
Please help me before my head goes Boom!
I have never coded a text editor before and I have'nt found
any help elsewhere about this kind of problem.
I am quite new to VB.Net.
|
|
|
|
|
You can use regular expressions, or there's a function called 'findfirstindex' or something that will search an entire string for a known substring.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi everybody, I got a short question regarding the WM_PRINT message in VB. It seems to me that the windows that Visual Basic 6 builds are not acting correclty when they receive this message. I got a big problem with this because I need to save in a memory DC the contents of a Window even IF IT IS NOT CURRENTLY DISPLAYED on the screen.
This is very frustrating, since even though I send a WM_PRINT message to the VB application, it does not print the client area. WM_PRINTCLIENT messages are also not working.
So the bottom line is: does ANYBODY know how I can override the OnPaint function of the window that the VB creates? I can subclass the window and get the WM_PRINT message, but I can't do anything upon receiving it, unless I can somehow determine the window to print itself in the specified DC. I can do this only by having access to the OnPaint function.
Thank you in advance for helping : D.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
I have a form which contains a richtextbox and a Toolbar with some buttons for change text : copy/delete/cut/paste/Bold/Italic/underLine/Color and ....
when I change my text in the richtextbox for example bold a word in my text, now If I use PrintForm method then it cannt print my Text in richtextbox while that word is bold.
how can print my richtextbox content exactly?
|
|
|
|
|
|
Hi I am working on CRM using ASP.net with VB.net... Actualy I want to generate controles say asp:textbox dynamicaly. But I am not able to this can any one help me in this regard.
Thanx in advance and Prayers after answer . Take care
Hope 4 the Best but Prepare 4 the Worst....!
|
|
|
|
|
Something like this
Dim tb as Textbox = new TextBox ( or however this goes, I'm a C# guy ).
Then you have a control, but it's not part of your page. You need to put a placeholder where you want to put your control, or create a repeater, or similar, which will give you a row object. Either the row or the placeholder has a controls property, you need to add your new control to the controls collection for it to appear in the page. Then you need to be careful to do this consitently and early in the page lifecycle or you'll find you won't get events or viewstate for the control.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have a dataTable with an integer column called RAM_amt for amount of RAM on a machine. The DataTable is populated by a business logic object that I cannot change.
The RAM_amt is in bytes but I want the text box to display it in megabytes if the value let say is less than 1000 megabytes and display in gigabytes if the value is 1 gigabyte or more.
The logic is pretty easy but where would I put this code? Where is the msot efficient place to put this?
|
|
|
|
|
This is just an idea but perhaps you could programmatically add another column to the DataTable to use for the friendly display of the amount of RAM. After adding the new column perform a loop for each row in the DataTable and update the new column based on your "RAM_amt" column. Then bind that new column to your TextBox through code.
You would place this code somewhere after getting the DataTable. You can then remove any existing bindings for the TextBox and add the new one. Assuming you had a DataTable called dt it might look something like the code below.
dt.Columns.Add("RAM_text", Type.GetType("System.String"))<br />
Dim dr As DataRow<br />
For Each dr In dt.Rows<br />
dr("RAM_text") = GetFriendlySize(dr("RAM_amt"))<br />
Next<br />
TextBox1.DataBindings.Clear()<br />
TextBox1.DataBindings.Add(New Binding("Text", dt, "RAM_text"))
GetFriendlySize() would be a Function that calculates the display text from the byte value.
|
|
|
|