|
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.
|
|
|
|
|
Does anyone think that using complex data binding to synchronize a listbox to textboxes is bad? I am binding a listbox to the same dataTable that 5 other textboxes are bound to so that the listbox works as a navigator.
For what I'm doing this seems like a quicker but also more efficient and error free solution.
Here are my other options
1. Manually through loops populate the listbox from the datatable. Then add a Listbox.selectedIndexChange handler to do a dataTable.rows.find for the selected item on the listbox. Then refresh the appropriate text boxes.
2. Bind only the listbox to the datatable. Then add a Listbox.selectedIndexChange handler to do a dataTable.rows.find for the selected item on the listbox. Then refresh the appropriate text boxes.
I've read some articles saying that complex databinding is bad programming practice.
Is there a performance gain by complex binding versus manual code?
|
|
|
|
|
hi all,
how do i know whether capslock is on?
i do not mean whether is is pressed, something like this this doesnt work
class form1 'keypreview is true
inherits form
'windows forms designer generated code etc
private CapsOn as boolean = false
protected overrides sub onkeydown(e as keyeventargs)
mybase.onkeydown(e)
if e.keycode = keys.capslock then capson = not capson
end sub
end class
beacuse when capslock is on before app starts stuff goes the wrong way around...
does anyone have a idea?
a api or something?
thanks, mouzik
|
|
|
|
|
.Net framework didn't encapsulate all the Windows APIs yet so you will have to call the following windows api:
Private Declare Function GetKeyState Lib "user32" (ByVal virtKey As Integer) As Short
Then call it.
For example:
if GetKeyState(Keys.CapsLock) = 1 then capson = true
|
|
|
|
|
thanks rudy!
although it didnt work at first, i got it working in the end:
Private Declare Function GetKeyState Lib "user32" (ByVal virtKey As Integer) As Integer
and to call it:
CapsOn = CBool((GetKeyState(Keys.CapsLock) And 65535) - 65408))
thanks again!
|
|
|
|
|
Hi i have converted a visual basic 6 project into vb.net.The project has a splash form then login form and then a main form. but what happens after i run the project the splash form appears and on its keypress event the login form is to get loaded but it closes the project . i donot know why. if i make login form the default startup object then also after its a right login it does not dispaly the main form and the project closes. pls help. me and if i use show dialog method then the formLoad events of the forms are not called and no defualt values are set which i try to set them on form load event. Pls tell me something
Thanks
|
|
|
|
|
Normally .net form apps are started by something like this:
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
If you have this and Form1 is your splash screen then the application will exit because it only runs as long as Form1 is open.
So inside the Run statement your application main form should be inserted. All other forms could be shown before this statement. Whats best in your situation depends on your special requirements.
|
|
|
|
|
Does anyone know any techiniques, tricks or anything cool about customizing command buttons and the way they look such as changing their shape, texture etc...???
|
|
|
|
|
Searching CodeProject will give you several hits.
I personally think this and this are fancy.
|
|
|
|
|
hi all,
how do i get the size of a file?
i have looked in the io.file class , but couldnt find a GetFileSize function or something
does anyone have an idea
thanks, mouzik
|
|
|
|
|
Try new System.IO.FileInfo(fileName).Length
|
|
|
|
|