|
Hi,
Here is an example -
window.open("http://www.w3schools.com","_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=400")<br />
I copied it from here[^]
http://www.w3schools.com/[^] is a good site for learning HTML and scripting.
Have a look at the site.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
I am using the mciSendString method in my project where i am unable to get the length of the wave file playing.Help me.....
Framework version is v1.1,Visual Studio .Net 2003
mciSendString("open c:/MyMedia/Babu.wav type waveaudio alias song","MCI_OPEN",128,0)
mciSendString("set song time format hms","MCI_SET_TIME_FORMAT",255,0)
mciSendString("status song length",rs,255,0)
mciSendString("play song from 1 to 6000 wait","MCI_PLAY",255,0)
Advance thanx.
C.Babu B.E.,
-- modified at 0:50 Monday 13th November, 2006
|
|
|
|
|
Hello,
I am using vb 2005 and sql server 2005, windows form.
I have a checkedlistbox that is populated from a database. See code below. I am wondering what is the best way to save the items that have been clicked to the database.
Private Sub loadGroups()<br />
Dim objGetGroups As New BL_Groups()<br />
Dim ds As New DataSet()<br />
ds = objGetGroups.getAllGroups()<br />
Dim dt As New DataTable()<br />
Dim i As Integer<br />
dt = ds.Tables(0)<br />
<br />
Try<br />
For i = 0 To ds.Tables(0).Rows.Count - 1<br />
Me.chkLstSecurityRoles.Items.Add(dt.Rows(i).Item("Privilege")).ToString()<br />
Next<br />
Catch ex As Exception<br />
MessageBox.Show(ex.Message)<br />
End Try<br />
<br />
End Sub<CODE><br />
Is it good to put them in to an array and them to a store procedure. <br />
<br />
If the user clicks 20 items, then I would have to do 20 inserts. That doesn't sound too efficient. <br />
<br />
The code I have for finding the checked items is below<br />
<CODE> Dim i As Integer<br />
Dim strChecked As String<br />
<br />
For i = 0 To Me.chkLstSecurityRoles.CheckedItems.Count - 1<br />
<br />
strChecked = Me.chkLstSecurityRoles.CheckedItems(i).ToString()<br />
Next
At the moment I am using seeing that the right items are correct, that is why i have a string value.
However, my problem is what is the best way to save this to a database. Any code examples would be grateful.
Thanks in advance,
Steve
|
|
|
|
|
hi , iam college student from indonesia,could anyone know How Syncronize Outlook Address Book P2P via bluetooth, i was search about document but i don't found it, i hope you all can help me by give suggest,source, or link, thanx contact me at <tebas_bush@yahoo.com>
|
|
|
|
|
My Previous message 0n the 26 october 2006
Hi, using VB net(2003) I have 2 questions. First how to change dynamically the property of textAlign in a textBox, see my ex: property of textAlign in the textBox1 is already set to the right, what I would like to do is when I change the value in that txtBox would be that data move to left, and after I finish then hit tab button on keyboard data move back to the right. My second question is how to set a value like zero 0 as a default in that same textBox only when that textBox is empty. Thank you in advance for your help.
Your Answer
You just need to capture the events: Enter and Leave
> This code might help you:
>
> Private Sub TextBox1_Enter(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles TextBox1.Enter
> Me.TextBox1.TextAlign = HorizontalAlignment.Left
> End Sub
Private Sub TextBox1_Leave(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles TextBox1.Leave
> Me.TextBox1.TextAlign = HorizontalAlignment.Right
> End Sub
If you are using this code many times, you might wanna implement this code
> in your custom textbox, so you wont have to repeat this code for every
> textbox you have in your form.
Hi, good evening Alexei, Your solution for my text property is working fine thank you
Since I have about 25 textBox on that 3 pages Forms and you have mentioned that I should use a custom textbox, How to do that? And also would it be possible for the Leave Event to use either the Tab on the keyboard or the mouse. Thank you in advance for your help.
|
|
|
|
|
LOL - generally, you want to respond to the response, if you want the same person to see it and answer you.
You derive a class from the Textbox class, use that in your code, and set the properties within that class.
The Leave event is fired when your control loses focus, you'd have to catch the Tab key and advance the tab order instead of having a Tab go into your textbox. There may be a property for this.
|
|
|
|
|
Hello, how can I create a temporary mime filter for IE in vb.net (or c#)?
I know i have to use IInternetSession and other interfaces in urlmon.dll.
I tried to convert some C++ code to VB but i receive several access violation exceptions:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'CComPtr<IInternetSession> m_spSession ;
Dim m_spSession As UrlMon.IInternetSession
'CComPtr<IClassFactory> m_spClassFactoryMime ;
Dim m_spClassFactoryMime As UrlMon.IClassFactory
'hr = ::CoGetClassObject( CLSID_MimeFilter, CLSCTX_SERVER,
' NULL, IID_IClassFactory,
' (void**)&m_spClassFactoryMime );
m_spClassFactoryMime = CoGetClassObject(GetStdGUID("FC3BAAF1-AD41-4141-BC28-5167E29E3B14"), CLSCTX.CLSCTX_SERVER, _
IntPtr.Zero, GetStdGUID("00000001-0000-0000-C000-000000000046"))
'if( hr == S_OK )
'{
' if( ::CoInternetGetSession( 0, &m_spSession, 0) ==S_OK )
CoInternetGetSession(0, m_spSession, 0)
' {
' m_spSession->RegisterMimeFilter(m_spClassFactoryMime,
' CLSID_MimeFilter,
' L"text/html" );
m_spSession.RegisterMimeFilter(m_spClassFactoryMime, New Guid("FC3BAAF1-AD41-4141-BC28-5167E29E3B14"), "text/html")
' }
'}
Me.AxWebBrowser1.Navigate("http://gouki/alieni.htm")
End Sub
CoGetClassObject generates the access violation exception...
Any idea or example?
|
|
|
|
|
|
Replace \" against "" and remove the semicolons.
---
b { font-weight: normal; }
|
|
|
|
|
_jsSingle = _jsSingle.Insert(11, "setTimeout(""")
_jsSingle &= """, 300)"
(+= will work also, but it's best to use the dedicated unambiguous concatenation operator in VB).
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter, VB to C++ converter
Instant Python: VB to Python converter
|
|
|
|
|
|
ahum.. could you help me with this one also ? thanx!
protected override void Render(HtmlTextWriter writer)
{
foreach (GridViewRow r in GridView1.Rows)
{
if (r.RowType == DataControlRowType.DataRow)
{
Page.ClientScript.RegisterForEventValidation(r.UniqueID + "$ctl00");
Page.ClientScript.RegisterForEventValidation(r.UniqueID + "$ctl01");
}
}
base.Render(writer);
}
|
|
|
|
|
I've come up with this but the me.render isn't right... hints anyone ?
Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
For Each r As GridViewRow In AgendaView.Rows
If r.RowType = DataControlRowType.DataRow Then
Page.ClientScript.RegisterForEventValidation(r.UniqueID + "$ctl00")
Page.ClientScript.RegisterForEventValidation(r.UniqueID + "$ctl01")
End If
Next r
Me.Render(writer)
End Sub
|
|
|
|
|
Use:
MyBase.Render(writer)
Also, it's better to use the "&" concatenation operator in VB since there is no ambiguity ("+" can have undesired results if Option Strict is not set).
(feel free to download the Instant VB demo to convert these types of examples).
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter, VB to C++ converter
Instant Python: VB to Python converter
|
|
|
|
|
thank you again! i will try your app! hope i do not come across too many examples in C# instead of vb...
|
|
|
|
|
Hello,
I've drawn a datagrid on my form, and called it grdDataGrid.
I'm looping through a text file to collect relevant column data - putting each portion of my line into variables for Product ID, Transaction Code, Quantity, and Value.
I can't use the split command because the source text file isn't formatted too well, so I'm having to use SubString to collect the required data.
How do I put Product ID, Trans Code, Qty and Value into their own columns in the data grid?
|
|
|
|
|
Hi All!
I've been trying to draw a spectral trace to a picturebox in visual studio Visual basic 2005, but for some reason i cant find out how?!
I need to plot a graph of 500 dots to screen so I assumed the easiest is to draw this in a picturebox. Is this true?
The curve function seems to be the right way to go even though it would be easier to simply draw lines between the dots since as far as i can see this will greatly reduce the ammount of code needed.
I tried the next code:
e.Graphics.DrawCurve(greenPen, curvePoints)
Where curvepoints is populated by an array of points as explained in the msdn description. Do i need to be more specific to draw to a picturebox?
Does anybody know why i dont see anything in my form?
Any tips are very welcome (as i am getting frustrated after not getting a single line on screen )
Cheers
Bas
-- modified at 15:47 Sunday 12th November, 2006
|
|
|
|
|
Why do so many people try to draw onto picture boxes ? You draw onto an Image or Bitmap, THEN you can worry about displaying it ( use a picturebox if you must ).
It's easier to handle your paint event and draw onto that directly.
|
|
|
|
|
Hi Christian,
Thanks for your reply.. it did put thins in another perspective.
Since i am a newbie in the .Net environment, graphics is completely new to me. Could someone explain me in a few words how I can draw a line onto a graphical image and then put it in a Picturebox on the screen?
Thanks a lot for helping!!
Cheers
BaZ
|
|
|
|
|
Bitmap bm = new Bitmap (200, 200); // I think you need to set a pixel depth as well )
using (Graphics gr = Graphics.FromBitmap(bm))
{
gr.DrawLine(20, 20, Pens.White); // Something like that
}
You don't need a picturebox, but you can pass the bitmap to a picturebox here if you like
I'd prefer to make the bitmap a member, or to draw directly onto the graphics object in the paint event.
|
|
|
|
|
I have two option boxes, "optEnabled" and "optDisabled". I need to read a REG_BINARY Value from the key "HKEY_CURRENT_USER\Software\MyApp\DSBkgnd". If the value is "00000000" I need to set optEnabled to Checked an if the value is "01000000" set optDisabled to Checked. I have followed examples on msdn but they wouldn't work.
If anyone can provide the code or suggestions i would be very grateful
|
|
|
|
|
Puggsley wrote: I have followed examples on msdn but they wouldn't work.
Then you didn't follow them properly. Try posting your code. That would also tell us if you're using VB6 or VB.NET.
|
|
|
|
|
Dim readValue As String
readValue = My.Computer.Registry.GetValue_(HKEY_CURRENT_USER\Software\Microsoft\MessengerService", "DSBkgndMode", 0)
If readValue = "00000000" Then
OptEnabled.Checked = True
OptDisabled.Checked = False
Else
OptEnabled.Checked = False
OptDisabled.Checked = True
End If
I have tried using a message box to display the value of readValue but it was always blank
|
|
|
|
|
Well, this won't compile.
readValue = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Microsoft\MessengerService", "DSBkgndMode", "0")
You probably then want to convert the value to a number, and compare that.
Why have an enabled checkbox and a disabled one ? Isn't that redundant ?
|
|
|
|
|
Also - have you checked if that key exists at all ? DSBkgndMode doesn't exist on my machine.
|
|
|
|
|