|
It sounds like there is no set tab order, that you are figuring out at runtime.
I use this to enable/disable our controls tabstops,
''' <summary>
''' This sets the tab stops to false when in inquire mode and tab stops to true if in update mode.
''' </summary>
''' <param name="c">C is the control from the calling form</param>
''' <param name="bStatus">This sets the control tabstops to True (enabled) false (disabled)</param>
''' <remarks></remarks>
Public Sub sInitializeControls(ByVal c As Control, ByVal bStatus As Boolean)
'This routine needs to be ran after a form is loaded
'When we enable and disable controls the cursor will stop on the controls that have been disabled
'This is a recursive function
'c = Control from Calling form
'
Dim ctrl As Control
For Each ctrl In c.Controls
If String.Compare(ctrl.Name, "btnClose") = 0 Or String.Compare(ctrl.Name, "btnCancel") = 0 Then
'exit
Else
ctrl.TabStop = bStatus
If ctrl.HasChildren Then
sInitializeControls(ctrl, bStatus)
End If
End If
Next
End Sub
You might be able to modify this to your needs.
I would think you could call this to set all tab stops false and then in the validation routine you could set the specific control you are wanting to move to
like so
control.tabstop = true
control.focus() or control.select()I have found the latter of these two to be more reliable
Humble Programmer
|
|
|
|
|
I have tried changing the tab stop with no luck. So, are you saying there is no way to force a tab through code?
|
|
|
|
|
does the gotfocus/enter routine fire if you hit tab? if so, test if the control is disabled and then issue a
My.Computer.Keyboard.SendKeys("{TAB}")
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
Take a look at the Control.SelectNextControl method. It may be what you want.
Alan.
|
|
|
|
|
This shouldn't even be an issue. How I did it in the past is enable the Form's KeyPreview, then handle it's KeyDown event. This handler should look for the preamble keysequence, eat the keys so they don't go to the controls, then start reading each key and appending to a string, until you see the postamble sequence, being sure to eat those keys. Then you've got the barcode, having never input the thing into a TextBox.
|
|
|
|
|
Hi I need a way to link upto 17 pivot tables so that when one pivot table's page (report fields) changes, all the other related ones change.
Has anyone any knowledge on how to do this?
Thanks
Paul
|
|
|
|
|
Hi!
I have a html table which is generated programatically. I need to send this table as an email I saw somewhere in internet that I need to use string builder to crop the text.could anyone please help?
<!--tablestarts--> -->is the starting text
<TABLE id="Table2" cellSpacing="0" cellPadding="4" runat="server">
<tr>
<td colSpan="5">Please confirm if your cart details are correct. Click "Order Now" to Order or else please press "Modify my Cart" to Modify your cart.</td>
</tr>
<TR >
<TD width="30%">Product Name:</TD>
<TD width="30%">Quantity:</TD>
<TD width="10%">UnitPrice:</TD>
<TD width="10%">Amount:</TD>
</TR>
</TABLE>
<!--tableends->--> ending
so i need to get the string in between those two and send as a email
how can i do that? a code hint will be really use ful.
|
|
|
|
|
uglyeyes wrote: so i need to get the string in between those two and send as a email
So, you have a string with much more in it because all you've shown is the table.
I'd probably use a Regular Expression to extract the table rather than use a StringBuilder. I don't think you can use a StringBuilder to find existing text, just manipulate the text.
|
|
|
|
|
how do i make following pseudo code work to fit my criteria
Mailmsg.body += regex.split(getAllCurrentPageContent, REGEX to get only strings starting from '<!--tablestarts-->' and ending at '<!--tablestarts-->')
in above could you please help as to how i get all the current pagecontent and appropriate regex?
when the email is sent will the table will render properly?
thanks in advance
|
|
|
|
|
The table will render properly if you send the mail as HTML. Not all clients support HTML though.
I are troll
|
|
|
|
|
I have already tried using
Table2.InnerHtml but i get not supported exception. now my only question is
also I have tried using below
Dim SB As New StringBuilder()
Dim SW As New StringWriter(SB)
Dim htmlTW As New HtmlTextWriter(SW)
Table2.RenderControl(htmlTW)
Dim tbl As String = SB.ToString()
MailMsg.Body += tbl
but this doesnt gives me the dynamically generated records.
how do i get currently rendered html content via aspx page(please note contents of Table2 is generated dynamically) and how do i use regex to only copy Table2's content.
please help
modified on Wednesday, January 7, 2009 11:13 AM
|
|
|
|
|
The examples below might help you;
http://dotnettricks.com/blogs/craigbowesblog/archive/2006/09/09/105.aspx
http://blogs.x2line.com/al/articles/859.aspx
--
What does it give you then? If the code runs correct, you should get the HTML as generated by "Table2". Does it?
I are troll
|
|
|
|
|
I have already tried what is mentioned in the article.
This only gives what is already in TAble2 before rendering Table2 programatically. here is what TAble2 has before its rendered programatically
<TABLE id="Table2" cellSpacing="0" cellPadding="4" runat="server">
<TR >
<TD width="30%">Product Name:</TD>
<TD width="30%">Quantity:</TD>
<TD width="10%">UnitPrice:</TD>
<TD width="10%">Amount:</TD>
</TR>
</TABLE>
the scripts mentioned in the article only gives me above but not the end result. i.e additional rows that are created programatically.
could someone please help?
|
|
|
|
|
sorry this works fine. I think the postback was causing the programatically created data not being loaded
I did this before I do postback
cache("data") = RenderControls(Table2) --> this comes from one of the links you provided me.
and it Mailmsg.body +=cache("data")
Thanks very much
|
|
|
|
|
Here is another idea. If your HTML is actually XHTML (basically HTML that complies with the stricter rules governing XML) then you could load it into an XDocument (if you have .NET 3.5) or XmlDocument (for any version of .NET) and extract it using XPath, or navigating to the appropriate node and performing InnerXml (or OuterXml ).
|
|
|
|
|
|
HI!
How kan I List the ”user logon (pre windows....)” on aspx-page?
I have win 2003 server and VS2005.
Thanks
HD
|
|
|
|
|
|
I guess that's "before" the user logs in to Windows?
Doesn't make sense either way
I are troll
|
|
|
|
|
Awesome sig.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Thanks to the reply!
But I meen How to extract Active Directories Properties.
Some of them are in form of collections (name:value).
And others are in Com objects, this is the problem. Here an axampel.
nSNCreated:System._ComObject
nSNChanged:System._ComObject
How can I get the value for those Properties?
Thanks
HD
|
|
|
|
|
The System.DirectoryServices namespace built into the .NET Framework is designed to provide programming access to LDAP directories (Active Directory).
I'd recommend this article
I are troll
|
|
|
|
|
Thanks to u, I will read it.
I hops that it will helps
|
|
|
|
|
Hello All,
Happy New Year.
I am developing an application in vb.net 3.5
I have a MDI form and Several Child Form. In my MDI form I put some Button Like Save,Exit ...
In these button Click Event I called the Save function or exit function of the Child Forms.
Suppose I have Two Child Form "Form1" and "Form2"
In the MDI Save Button Click I call the different events different "Form1.Save" or "Form2.Save".
But There is a Focus problem In my Child forms. If I am go for "Form1.Save" its working, but after save the focus will be return back to the "Form1", Then If I doing any activity in my "Child1" it throws an error message "Object reference not set to an instance of the object..."
and also a strange problem occures in my form after these any event will be called twice.
So, What is the Solution of this problem.
Please Help me.
Arindam Banerjee
Sr. Software Developer
Rance Computer Pvt Ltd.
Kolkata (India)
|
|
|
|
|
pdnet wrote: If I am go for "Form1.Save" its working, but after save the focus will be return back to the "Form1",
So the focus is staying in the form that was active? Or do you mean that if you're on form2 and you press save for form1 the focus goes to form1. If that's the case, you most likely set the focus during the save.
pdnet wrote: hen If I doing any activity in my "Child1" it throws an error message "Object reference not set to an instance of the object..."
Didn't quite get what was child1 but I'd guess you store a reference to your form somewhere which is at call time nonexistent.
pdnet wrote: also a strange problem occures in my form after these any event will be called twice
Most likely you have duplicate handlers for those events.
|
|
|
|